/*! For license information please see 371.js.LICENSE.txt */
(self.webpackChunkmp_webgl = self.webpackChunkmp_webgl || []).push([
  [371],
  {
    27251: (t, e, i) => {
      "use strict";
      i.r(e),
        i.d(e, {
          TransformControls: () => TransformControls,
          TransformControlsGizmo: () => TransformControlsGizmo,
          TransformControlsPlane: () => TransformControlsPlane,
        });
      var n = i(2212);
      const s = new n.Raycaster(),
        r = new n.Vector3(),
        a = new n.Vector3(),
        o = new n.Quaternion(),
        l = {
          X: new n.Vector3(1, 0, 0),
          Y: new n.Vector3(0, 1, 0),
          Z: new n.Vector3(0, 0, 1),
        },
        h = { type: "change" },
        d = { type: "mouseDown" },
        c = { type: "mouseUp", mode: null },
        u = { type: "objectChange" };
      class TransformControls extends n.Object3D {
        constructor(t, e) {
          super(),
            void 0 === e &&
              (console.warn(
                'THREE.TransformControls: The second parameter "domElement" is now mandatory.'
              ),
              (e = document)),
            (this.visible = !1),
            (this.domElement = e);
          const i = new TransformControlsGizmo();
          (this._gizmo = i), this.add(i);
          const s = new TransformControlsPlane();
          (this._plane = s), this.add(s);
          const r = this;
          function a(t, e) {
            let n = e;
            Object.defineProperty(r, t, {
              get: function () {
                return void 0 !== n ? n : e;
              },
              set: function (e) {
                n !== e &&
                  ((n = e),
                  (s[t] = e),
                  (i[t] = e),
                  r.dispatchEvent({ type: t + "-changed", value: e }),
                  r.dispatchEvent(h));
              },
            }),
              (r[t] = e),
              (s[t] = e),
              (i[t] = e);
          }
          a("camera", t),
            a("object", void 0),
            a("enabled", !0),
            a("axis", null),
            a("mode", "translate"),
            a("translationSnap", null),
            a("rotationSnap", null),
            a("scaleSnap", null),
            a("space", "world"),
            a("size", 1),
            a("dragging", !1),
            a("showX", !0),
            a("showY", !0),
            a("showZ", !0);
          const o = new n.Vector3(),
            l = new n.Vector3(),
            d = new n.Quaternion(),
            c = new n.Quaternion(),
            u = new n.Vector3(),
            g = new n.Quaternion(),
            b = new n.Vector3(),
            y = new n.Vector3(),
            v = new n.Vector3(),
            E = new n.Vector3();
          a("worldPosition", o),
            a("worldPositionStart", l),
            a("worldQuaternion", d),
            a("worldQuaternionStart", c),
            a("cameraPosition", u),
            a("cameraQuaternion", g),
            a("pointStart", b),
            a("pointEnd", y),
            a("rotationAxis", v),
            a("rotationAngle", 0),
            a("eye", E),
            (this._offset = new n.Vector3()),
            (this._startNorm = new n.Vector3()),
            (this._endNorm = new n.Vector3()),
            (this._cameraScale = new n.Vector3()),
            (this._parentPosition = new n.Vector3()),
            (this._parentQuaternion = new n.Quaternion()),
            (this._parentQuaternionInv = new n.Quaternion()),
            (this._parentScale = new n.Vector3()),
            (this._worldScaleStart = new n.Vector3()),
            (this._worldQuaternionInv = new n.Quaternion()),
            (this._worldScale = new n.Vector3()),
            (this._positionStart = new n.Vector3()),
            (this._quaternionStart = new n.Quaternion()),
            (this._scaleStart = new n.Vector3()),
            (this._getPointer = p.bind(this)),
            (this._onPointerDown = _.bind(this)),
            (this._onPointerHover = f.bind(this)),
            (this._onPointerMove = m.bind(this)),
            (this._onPointerUp = w.bind(this)),
            this.domElement.addEventListener(
              "pointerdown",
              this._onPointerDown
            ),
            this.domElement.addEventListener(
              "pointermove",
              this._onPointerHover
            ),
            this.domElement.ownerDocument.addEventListener(
              "pointerup",
              this._onPointerUp
            );
        }
        updateMatrixWorld() {
          void 0 !== this.object &&
            (this.object.updateMatrixWorld(),
            null === this.object.parent
              ? console.error(
                  "TransformControls: The attached 3D object must be a part of the scene graph."
                )
              : this.object.parent.matrixWorld.decompose(
                  this._parentPosition,
                  this._parentQuaternion,
                  this._parentScale
                ),
            this.object.matrixWorld.decompose(
              this.worldPosition,
              this.worldQuaternion,
              this._worldScale
            ),
            this._parentQuaternionInv.copy(this._parentQuaternion).invert(),
            this._worldQuaternionInv.copy(this.worldQuaternion).invert()),
            this.camera.updateMatrixWorld(),
            this.camera.matrixWorld.decompose(
              this.cameraPosition,
              this.cameraQuaternion,
              this._cameraScale
            ),
            this.eye
              .copy(this.cameraPosition)
              .sub(this.worldPosition)
              .normalize(),
            super.updateMatrixWorld(this);
        }
        pointerHover(t) {
          if (void 0 === this.object || !0 === this.dragging) return;
          s.setFromCamera(t, this.camera);
          const e = g(this._gizmo.picker[this.mode], s);
          this.axis = e ? e.object.name : null;
        }
        pointerDown(t) {
          if (
            void 0 !== this.object &&
            !0 !== this.dragging &&
            0 === t.button &&
            null !== this.axis
          ) {
            s.setFromCamera(t, this.camera);
            const e = g(this._plane, s, !0);
            if (e) {
              let t = this.space;
              if (
                ("scale" === this.mode
                  ? (t = "local")
                  : ("E" !== this.axis &&
                      "XYZE" !== this.axis &&
                      "XYZ" !== this.axis) ||
                    (t = "world"),
                "local" === t && "rotate" === this.mode)
              ) {
                const t = this.rotationSnap;
                "X" === this.axis &&
                  t &&
                  (this.object.rotation.x =
                    Math.round(this.object.rotation.x / t) * t),
                  "Y" === this.axis &&
                    t &&
                    (this.object.rotation.y =
                      Math.round(this.object.rotation.y / t) * t),
                  "Z" === this.axis &&
                    t &&
                    (this.object.rotation.z =
                      Math.round(this.object.rotation.z / t) * t);
              }
              this.object.updateMatrixWorld(),
                this.object.parent.updateMatrixWorld(),
                this._positionStart.copy(this.object.position),
                this._quaternionStart.copy(this.object.quaternion),
                this._scaleStart.copy(this.object.scale),
                this.object.matrixWorld.decompose(
                  this.worldPositionStart,
                  this.worldQuaternionStart,
                  this._worldScaleStart
                ),
                this.pointStart.copy(e.point).sub(this.worldPositionStart);
            }
            (this.dragging = !0), (d.mode = this.mode), this.dispatchEvent(d);
          }
        }
        pointerMove(t) {
          const e = this.axis,
            i = this.mode,
            n = this.object;
          let d = this.space;
          if (
            ("scale" === i
              ? (d = "local")
              : ("E" !== e && "XYZE" !== e && "XYZ" !== e) || (d = "world"),
            void 0 === n ||
              null === e ||
              !1 === this.dragging ||
              -1 !== t.button)
          )
            return;
          s.setFromCamera(t, this.camera);
          const c = g(this._plane, s, !0);
          if (c) {
            if (
              (this.pointEnd.copy(c.point).sub(this.worldPositionStart),
              "translate" === i)
            )
              this._offset.copy(this.pointEnd).sub(this.pointStart),
                "local" === d &&
                  "XYZ" !== e &&
                  this._offset.applyQuaternion(this._worldQuaternionInv),
                -1 === e.indexOf("X") && (this._offset.x = 0),
                -1 === e.indexOf("Y") && (this._offset.y = 0),
                -1 === e.indexOf("Z") && (this._offset.z = 0),
                "local" === d && "XYZ" !== e
                  ? this._offset
                      .applyQuaternion(this._quaternionStart)
                      .divide(this._parentScale)
                  : this._offset
                      .applyQuaternion(this._parentQuaternionInv)
                      .divide(this._parentScale),
                n.position.copy(this._offset).add(this._positionStart),
                this.translationSnap &&
                  ("local" === d &&
                    (n.position.applyQuaternion(
                      o.copy(this._quaternionStart).invert()
                    ),
                    -1 !== e.search("X") &&
                      (n.position.x =
                        Math.round(n.position.x / this.translationSnap) *
                        this.translationSnap),
                    -1 !== e.search("Y") &&
                      (n.position.y =
                        Math.round(n.position.y / this.translationSnap) *
                        this.translationSnap),
                    -1 !== e.search("Z") &&
                      (n.position.z =
                        Math.round(n.position.z / this.translationSnap) *
                        this.translationSnap),
                    n.position.applyQuaternion(this._quaternionStart)),
                  "world" === d &&
                    (n.parent &&
                      n.position.add(
                        r.setFromMatrixPosition(n.parent.matrixWorld)
                      ),
                    -1 !== e.search("X") &&
                      (n.position.x =
                        Math.round(n.position.x / this.translationSnap) *
                        this.translationSnap),
                    -1 !== e.search("Y") &&
                      (n.position.y =
                        Math.round(n.position.y / this.translationSnap) *
                        this.translationSnap),
                    -1 !== e.search("Z") &&
                      (n.position.z =
                        Math.round(n.position.z / this.translationSnap) *
                        this.translationSnap),
                    n.parent &&
                      n.position.sub(
                        r.setFromMatrixPosition(n.parent.matrixWorld)
                      )));
            else if ("scale" === i) {
              if (-1 !== e.search("XYZ")) {
                let t = this.pointEnd.length() / this.pointStart.length();
                this.pointEnd.dot(this.pointStart) < 0 && (t *= -1),
                  a.set(t, t, t);
              } else
                r.copy(this.pointStart),
                  a.copy(this.pointEnd),
                  r.applyQuaternion(this._worldQuaternionInv),
                  a.applyQuaternion(this._worldQuaternionInv),
                  a.divide(r),
                  -1 === e.search("X") && (a.x = 1),
                  -1 === e.search("Y") && (a.y = 1),
                  -1 === e.search("Z") && (a.z = 1);
              n.scale.copy(this._scaleStart).multiply(a),
                this.scaleSnap &&
                  (-1 !== e.search("X") &&
                    (n.scale.x =
                      Math.round(n.scale.x / this.scaleSnap) * this.scaleSnap ||
                      this.scaleSnap),
                  -1 !== e.search("Y") &&
                    (n.scale.y =
                      Math.round(n.scale.y / this.scaleSnap) * this.scaleSnap ||
                      this.scaleSnap),
                  -1 !== e.search("Z") &&
                    (n.scale.z =
                      Math.round(n.scale.z / this.scaleSnap) * this.scaleSnap ||
                      this.scaleSnap));
            } else if ("rotate" === i) {
              this._offset.copy(this.pointEnd).sub(this.pointStart);
              const t =
                20 /
                this.worldPosition.distanceTo(
                  r.setFromMatrixPosition(this.camera.matrixWorld)
                );
              "E" === e
                ? (this.rotationAxis.copy(this.eye),
                  (this.rotationAngle = this.pointEnd.angleTo(this.pointStart)),
                  this._startNorm.copy(this.pointStart).normalize(),
                  this._endNorm.copy(this.pointEnd).normalize(),
                  (this.rotationAngle *=
                    this._endNorm.cross(this._startNorm).dot(this.eye) < 0
                      ? 1
                      : -1))
                : "XYZE" === e
                ? (this.rotationAxis
                    .copy(this._offset)
                    .cross(this.eye)
                    .normalize(),
                  (this.rotationAngle =
                    this._offset.dot(
                      r.copy(this.rotationAxis).cross(this.eye)
                    ) * t))
                : ("X" !== e && "Y" !== e && "Z" !== e) ||
                  (this.rotationAxis.copy(l[e]),
                  r.copy(l[e]),
                  "local" === d && r.applyQuaternion(this.worldQuaternion),
                  (this.rotationAngle =
                    this._offset.dot(r.cross(this.eye).normalize()) * t)),
                this.rotationSnap &&
                  (this.rotationAngle =
                    Math.round(this.rotationAngle / this.rotationSnap) *
                    this.rotationSnap),
                "local" === d && "E" !== e && "XYZE" !== e
                  ? (n.quaternion.copy(this._quaternionStart),
                    n.quaternion
                      .multiply(
                        o.setFromAxisAngle(
                          this.rotationAxis,
                          this.rotationAngle
                        )
                      )
                      .normalize())
                  : (this.rotationAxis.applyQuaternion(
                      this._parentQuaternionInv
                    ),
                    n.quaternion.copy(
                      o.setFromAxisAngle(this.rotationAxis, this.rotationAngle)
                    ),
                    n.quaternion.multiply(this._quaternionStart).normalize());
            }
            this.dispatchEvent(h), this.dispatchEvent(u);
          }
        }
        pointerUp(t) {
          0 === t.button &&
            (this.dragging &&
              null !== this.axis &&
              ((c.mode = this.mode), this.dispatchEvent(c)),
            (this.dragging = !1),
            (this.axis = null));
        }
        dispose() {
          this.domElement.removeEventListener(
            "pointerdown",
            this._onPointerDown
          ),
            this.domElement.removeEventListener(
              "pointermove",
              this._onPointerHover
            ),
            this.domElement.ownerDocument.removeEventListener(
              "pointermove",
              this._onPointerMove
            ),
            this.domElement.ownerDocument.removeEventListener(
              "pointerup",
              this._onPointerUp
            ),
            this.traverse(function (t) {
              t.geometry && t.geometry.dispose(),
                t.material && t.material.dispose();
            });
        }
        attach(t) {
          return (this.object = t), (this.visible = !0), this;
        }
        detach() {
          return (
            (this.object = void 0),
            (this.visible = !1),
            (this.axis = null),
            this
          );
        }
        getMode() {
          return this.mode;
        }
        setMode(t) {
          this.mode = t;
        }
        setTranslationSnap(t) {
          this.translationSnap = t;
        }
        setRotationSnap(t) {
          this.rotationSnap = t;
        }
        setScaleSnap(t) {
          this.scaleSnap = t;
        }
        setSize(t) {
          this.size = t;
        }
        setSpace(t) {
          this.space = t;
        }
        update() {
          console.warn(
            "THREE.TransformControls: update function has no more functionality and therefore has been deprecated."
          );
        }
      }
      function p(t) {
        if (this.domElement.ownerDocument.pointerLockElement)
          return { x: 0, y: 0, button: t.button };
        {
          const e = t.changedTouches ? t.changedTouches[0] : t,
            i = this.domElement.getBoundingClientRect();
          return {
            x: ((e.clientX - i.left) / i.width) * 2 - 1,
            y: (-(e.clientY - i.top) / i.height) * 2 + 1,
            button: t.button,
          };
        }
      }
      function f(t) {
        if (this.enabled)
          switch (t.pointerType) {
            case "mouse":
            case "pen":
              this.pointerHover(this._getPointer(t));
          }
      }
      function _(t) {
        this.enabled &&
          ((this.domElement.style.touchAction = "none"),
          this.domElement.ownerDocument.addEventListener(
            "pointermove",
            this._onPointerMove
          ),
          this.pointerHover(this._getPointer(t)),
          this.pointerDown(this._getPointer(t)));
      }
      function m(t) {
        this.enabled && this.pointerMove(this._getPointer(t));
      }
      function w(t) {
        this.enabled &&
          ((this.domElement.style.touchAction = ""),
          this.domElement.ownerDocument.removeEventListener(
            "pointermove",
            this._onPointerMove
          ),
          this.pointerUp(this._getPointer(t)));
      }
      function g(t, e, i) {
        const n = e.intersectObject(t, !0);
        for (let t = 0; t < n.length; t++)
          if (n[t].object.visible || i) return n[t];
        return !1;
      }
      TransformControls.prototype.isTransformControls = !0;
      const b = new n.Euler(),
        y = new n.Vector3(0, 1, 0),
        v = new n.Vector3(0, 0, 0),
        E = new n.Matrix4(),
        x = new n.Quaternion(),
        k = new n.Quaternion(),
        A = new n.Vector3(),
        C = new n.Matrix4(),
        S = new n.Vector3(1, 0, 0),
        U = new n.Vector3(0, 1, 0),
        T = new n.Vector3(0, 0, 1),
        j = new n.Vector3(),
        L = new n.Vector3(),
        R = new n.Vector3();
      class TransformControlsGizmo extends n.Object3D {
        constructor() {
          super(), (this.type = "TransformControlsGizmo");
          const t = new n.MeshBasicMaterial({
              depthTest: !1,
              depthWrite: !1,
              transparent: !0,
              side: n.DoubleSide,
              fog: !1,
              toneMapped: !1,
            }),
            e = new n.LineBasicMaterial({
              depthTest: !1,
              depthWrite: !1,
              transparent: !0,
              linewidth: 1,
              fog: !1,
              toneMapped: !1,
            }),
            i = t.clone();
          i.opacity = 0.15;
          const s = t.clone();
          s.opacity = 0.33;
          const r = t.clone();
          r.color.set(16711680);
          const a = t.clone();
          a.color.set(65280);
          const o = t.clone();
          o.color.set(255);
          const l = t.clone();
          l.opacity = 0.25;
          const h = l.clone();
          h.color.set(16776960);
          const d = l.clone();
          d.color.set(65535);
          const c = l.clone();
          c.color.set(16711935);
          t.clone().color.set(16776960);
          const u = e.clone();
          u.color.set(16711680);
          const p = e.clone();
          p.color.set(65280);
          const f = e.clone();
          f.color.set(255);
          const _ = e.clone();
          _.color.set(65535);
          const m = e.clone();
          m.color.set(16711935);
          const w = e.clone();
          w.color.set(16776960);
          const g = e.clone();
          g.color.set(7895160);
          const b = w.clone();
          b.opacity = 0.25;
          const y = new n.CylinderGeometry(0, 0.05, 0.2, 12, 1, !1),
            v = new n.BoxGeometry(0.125, 0.125, 0.125),
            E = new n.BufferGeometry();
          function x(t, e) {
            const i = new n.BufferGeometry(),
              s = [];
            for (let i = 0; i <= 64 * e; ++i)
              s.push(
                0,
                Math.cos((i / 32) * Math.PI) * t,
                Math.sin((i / 32) * Math.PI) * t
              );
            return (
              i.setAttribute("position", new n.Float32BufferAttribute(s, 3)), i
            );
          }
          E.setAttribute(
            "position",
            new n.Float32BufferAttribute([0, 0, 0, 1, 0, 0], 3)
          );
          const k = {
              X: [
                [
                  new n.Mesh(y, r),
                  [1, 0, 0],
                  [0, 0, -Math.PI / 2],
                  null,
                  "fwd",
                ],
                [new n.Mesh(y, r), [1, 0, 0], [0, 0, Math.PI / 2], null, "bwd"],
                [new n.Line(E, u)],
              ],
              Y: [
                [new n.Mesh(y, a), [0, 1, 0], null, null, "fwd"],
                [new n.Mesh(y, a), [0, 1, 0], [Math.PI, 0, 0], null, "bwd"],
                [new n.Line(E, p), null, [0, 0, Math.PI / 2]],
              ],
              Z: [
                [new n.Mesh(y, o), [0, 0, 1], [Math.PI / 2, 0, 0], null, "fwd"],
                [
                  new n.Mesh(y, o),
                  [0, 0, 1],
                  [-Math.PI / 2, 0, 0],
                  null,
                  "bwd",
                ],
                [new n.Line(E, f), null, [0, -Math.PI / 2, 0]],
              ],
              XYZ: [
                [
                  new n.Mesh(new n.OctahedronGeometry(0.1, 0), l.clone()),
                  [0, 0, 0],
                  [0, 0, 0],
                ],
              ],
              XY: [
                [
                  new n.Mesh(new n.PlaneGeometry(0.295, 0.295), h.clone()),
                  [0.15, 0.15, 0],
                ],
                [new n.Line(E, w), [0.18, 0.3, 0], null, [0.125, 1, 1]],
                [
                  new n.Line(E, w),
                  [0.3, 0.18, 0],
                  [0, 0, Math.PI / 2],
                  [0.125, 1, 1],
                ],
              ],
              YZ: [
                [
                  new n.Mesh(new n.PlaneGeometry(0.295, 0.295), d.clone()),
                  [0, 0.15, 0.15],
                  [0, Math.PI / 2, 0],
                ],
                [
                  new n.Line(E, _),
                  [0, 0.18, 0.3],
                  [0, 0, Math.PI / 2],
                  [0.125, 1, 1],
                ],
                [
                  new n.Line(E, _),
                  [0, 0.3, 0.18],
                  [0, -Math.PI / 2, 0],
                  [0.125, 1, 1],
                ],
              ],
              XZ: [
                [
                  new n.Mesh(new n.PlaneGeometry(0.295, 0.295), c.clone()),
                  [0.15, 0, 0.15],
                  [-Math.PI / 2, 0, 0],
                ],
                [new n.Line(E, m), [0.18, 0, 0.3], null, [0.125, 1, 1]],
                [
                  new n.Line(E, m),
                  [0.3, 0, 0.18],
                  [0, -Math.PI / 2, 0],
                  [0.125, 1, 1],
                ],
              ],
            },
            A = {
              X: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 1, 4, 1, !1), i),
                  [0.6, 0, 0],
                  [0, 0, -Math.PI / 2],
                ],
              ],
              Y: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 1, 4, 1, !1), i),
                  [0, 0.6, 0],
                ],
              ],
              Z: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 1, 4, 1, !1), i),
                  [0, 0, 0.6],
                  [Math.PI / 2, 0, 0],
                ],
              ],
              XYZ: [[new n.Mesh(new n.OctahedronGeometry(0.2, 0), i)]],
              XY: [
                [new n.Mesh(new n.PlaneGeometry(0.4, 0.4), i), [0.2, 0.2, 0]],
              ],
              YZ: [
                [
                  new n.Mesh(new n.PlaneGeometry(0.4, 0.4), i),
                  [0, 0.2, 0.2],
                  [0, Math.PI / 2, 0],
                ],
              ],
              XZ: [
                [
                  new n.Mesh(new n.PlaneGeometry(0.4, 0.4), i),
                  [0.2, 0, 0.2],
                  [-Math.PI / 2, 0, 0],
                ],
              ],
            },
            C = {
              START: [
                [
                  new n.Mesh(new n.OctahedronGeometry(0.01, 2), s),
                  null,
                  null,
                  null,
                  "helper",
                ],
              ],
              END: [
                [
                  new n.Mesh(new n.OctahedronGeometry(0.01, 2), s),
                  null,
                  null,
                  null,
                  "helper",
                ],
              ],
              DELTA: [
                [
                  new n.Line(
                    (function () {
                      const t = new n.BufferGeometry();
                      return (
                        t.setAttribute(
                          "position",
                          new n.Float32BufferAttribute([0, 0, 0, 1, 1, 1], 3)
                        ),
                        t
                      );
                    })(),
                    s
                  ),
                  null,
                  null,
                  null,
                  "helper",
                ],
              ],
              X: [
                [
                  new n.Line(E, s.clone()),
                  [-1e3, 0, 0],
                  null,
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
              Y: [
                [
                  new n.Line(E, s.clone()),
                  [0, -1e3, 0],
                  [0, 0, Math.PI / 2],
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
              Z: [
                [
                  new n.Line(E, s.clone()),
                  [0, 0, -1e3],
                  [0, -Math.PI / 2, 0],
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
            },
            S = {
              X: [
                [new n.Line(x(1, 0.5), u)],
                [
                  new n.Mesh(new n.OctahedronGeometry(0.04, 0), r),
                  [0, 0, 0.99],
                  null,
                  [1, 3, 1],
                ],
              ],
              Y: [
                [new n.Line(x(1, 0.5), p), null, [0, 0, -Math.PI / 2]],
                [
                  new n.Mesh(new n.OctahedronGeometry(0.04, 0), a),
                  [0, 0, 0.99],
                  null,
                  [3, 1, 1],
                ],
              ],
              Z: [
                [new n.Line(x(1, 0.5), f), null, [0, Math.PI / 2, 0]],
                [
                  new n.Mesh(new n.OctahedronGeometry(0.04, 0), o),
                  [0.99, 0, 0],
                  null,
                  [1, 3, 1],
                ],
              ],
              E: [
                [new n.Line(x(1.25, 1), b), null, [0, Math.PI / 2, 0]],
                [
                  new n.Mesh(
                    new n.CylinderGeometry(0.03, 0, 0.15, 4, 1, !1),
                    b
                  ),
                  [1.17, 0, 0],
                  [0, 0, -Math.PI / 2],
                  [1, 1, 0.001],
                ],
                [
                  new n.Mesh(
                    new n.CylinderGeometry(0.03, 0, 0.15, 4, 1, !1),
                    b
                  ),
                  [-1.17, 0, 0],
                  [0, 0, Math.PI / 2],
                  [1, 1, 0.001],
                ],
                [
                  new n.Mesh(
                    new n.CylinderGeometry(0.03, 0, 0.15, 4, 1, !1),
                    b
                  ),
                  [0, -1.17, 0],
                  [Math.PI, 0, 0],
                  [1, 1, 0.001],
                ],
                [
                  new n.Mesh(
                    new n.CylinderGeometry(0.03, 0, 0.15, 4, 1, !1),
                    b
                  ),
                  [0, 1.17, 0],
                  [0, 0, 0],
                  [1, 1, 0.001],
                ],
              ],
              XYZE: [[new n.Line(x(1, 1), g), null, [0, Math.PI / 2, 0]]],
            },
            U = {
              AXIS: [
                [
                  new n.Line(E, s.clone()),
                  [-1e3, 0, 0],
                  null,
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
            },
            T = {
              X: [
                [
                  new n.Mesh(new n.TorusGeometry(1, 0.1, 4, 24), i),
                  [0, 0, 0],
                  [0, -Math.PI / 2, -Math.PI / 2],
                ],
              ],
              Y: [
                [
                  new n.Mesh(new n.TorusGeometry(1, 0.1, 4, 24), i),
                  [0, 0, 0],
                  [Math.PI / 2, 0, 0],
                ],
              ],
              Z: [
                [
                  new n.Mesh(new n.TorusGeometry(1, 0.1, 4, 24), i),
                  [0, 0, 0],
                  [0, 0, -Math.PI / 2],
                ],
              ],
              E: [[new n.Mesh(new n.TorusGeometry(1.25, 0.1, 2, 24), i)]],
              XYZE: [[new n.Mesh(new n.SphereGeometry(0.7, 10, 8), i)]],
            },
            j = {
              X: [
                [new n.Mesh(v, r), [0.8, 0, 0], [0, 0, -Math.PI / 2]],
                [new n.Line(E, u), null, null, [0.8, 1, 1]],
              ],
              Y: [
                [new n.Mesh(v, a), [0, 0.8, 0]],
                [new n.Line(E, p), null, [0, 0, Math.PI / 2], [0.8, 1, 1]],
              ],
              Z: [
                [new n.Mesh(v, o), [0, 0, 0.8], [Math.PI / 2, 0, 0]],
                [new n.Line(E, f), null, [0, -Math.PI / 2, 0], [0.8, 1, 1]],
              ],
              XY: [
                [new n.Mesh(v, h), [0.85, 0.85, 0], null, [2, 2, 0.2]],
                [new n.Line(E, w), [0.855, 0.98, 0], null, [0.125, 1, 1]],
                [
                  new n.Line(E, w),
                  [0.98, 0.855, 0],
                  [0, 0, Math.PI / 2],
                  [0.125, 1, 1],
                ],
              ],
              YZ: [
                [new n.Mesh(v, d), [0, 0.85, 0.85], null, [0.2, 2, 2]],
                [
                  new n.Line(E, _),
                  [0, 0.855, 0.98],
                  [0, 0, Math.PI / 2],
                  [0.125, 1, 1],
                ],
                [
                  new n.Line(E, _),
                  [0, 0.98, 0.855],
                  [0, -Math.PI / 2, 0],
                  [0.125, 1, 1],
                ],
              ],
              XZ: [
                [new n.Mesh(v, c), [0.85, 0, 0.85], null, [2, 0.2, 2]],
                [new n.Line(E, m), [0.855, 0, 0.98], null, [0.125, 1, 1]],
                [
                  new n.Line(E, m),
                  [0.98, 0, 0.855],
                  [0, -Math.PI / 2, 0],
                  [0.125, 1, 1],
                ],
              ],
              XYZX: [
                [
                  new n.Mesh(new n.BoxGeometry(0.125, 0.125, 0.125), l.clone()),
                  [1.1, 0, 0],
                ],
              ],
              XYZY: [
                [
                  new n.Mesh(new n.BoxGeometry(0.125, 0.125, 0.125), l.clone()),
                  [0, 1.1, 0],
                ],
              ],
              XYZZ: [
                [
                  new n.Mesh(new n.BoxGeometry(0.125, 0.125, 0.125), l.clone()),
                  [0, 0, 1.1],
                ],
              ],
            },
            L = {
              X: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 0.8, 4, 1, !1), i),
                  [0.5, 0, 0],
                  [0, 0, -Math.PI / 2],
                ],
              ],
              Y: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 0.8, 4, 1, !1), i),
                  [0, 0.5, 0],
                ],
              ],
              Z: [
                [
                  new n.Mesh(new n.CylinderGeometry(0.2, 0, 0.8, 4, 1, !1), i),
                  [0, 0, 0.5],
                  [Math.PI / 2, 0, 0],
                ],
              ],
              XY: [[new n.Mesh(v, i), [0.85, 0.85, 0], null, [3, 3, 0.2]]],
              YZ: [[new n.Mesh(v, i), [0, 0.85, 0.85], null, [0.2, 3, 3]]],
              XZ: [[new n.Mesh(v, i), [0.85, 0, 0.85], null, [3, 0.2, 3]]],
              XYZX: [
                [new n.Mesh(new n.BoxGeometry(0.2, 0.2, 0.2), i), [1.1, 0, 0]],
              ],
              XYZY: [
                [new n.Mesh(new n.BoxGeometry(0.2, 0.2, 0.2), i), [0, 1.1, 0]],
              ],
              XYZZ: [
                [new n.Mesh(new n.BoxGeometry(0.2, 0.2, 0.2), i), [0, 0, 1.1]],
              ],
            },
            R = {
              X: [
                [
                  new n.Line(E, s.clone()),
                  [-1e3, 0, 0],
                  null,
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
              Y: [
                [
                  new n.Line(E, s.clone()),
                  [0, -1e3, 0],
                  [0, 0, Math.PI / 2],
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
              Z: [
                [
                  new n.Line(E, s.clone()),
                  [0, 0, -1e3],
                  [0, -Math.PI / 2, 0],
                  [1e6, 1, 1],
                  "helper",
                ],
              ],
            };
          function O(t) {
            const e = new n.Object3D();
            for (const i in t)
              for (let n = t[i].length; n--; ) {
                const s = t[i][n][0].clone(),
                  r = t[i][n][1],
                  a = t[i][n][2],
                  o = t[i][n][3],
                  l = t[i][n][4];
                (s.name = i),
                  (s.tag = l),
                  r && s.position.set(r[0], r[1], r[2]),
                  a && s.rotation.set(a[0], a[1], a[2]),
                  o && s.scale.set(o[0], o[1], o[2]),
                  s.updateMatrix();
                const h = s.geometry.clone();
                h.applyMatrix4(s.matrix),
                  (s.geometry = h),
                  (s.renderOrder = 1 / 0),
                  s.position.set(0, 0, 0),
                  s.rotation.set(0, 0, 0),
                  s.scale.set(1, 1, 1),
                  e.add(s);
              }
            return e;
          }
          (this.gizmo = {}),
            (this.picker = {}),
            (this.helper = {}),
            this.add((this.gizmo.translate = O(k))),
            this.add((this.gizmo.rotate = O(S))),
            this.add((this.gizmo.scale = O(j))),
            this.add((this.picker.translate = O(A))),
            this.add((this.picker.rotate = O(T))),
            this.add((this.picker.scale = O(L))),
            this.add((this.helper.translate = O(C))),
            this.add((this.helper.rotate = O(U))),
            this.add((this.helper.scale = O(R))),
            (this.picker.translate.visible = !1),
            (this.picker.rotate.visible = !1),
            (this.picker.scale.visible = !1);
        }
        updateMatrixWorld(t) {
          const e =
            "local" === ("scale" === this.mode ? "local" : this.space)
              ? this.worldQuaternion
              : k;
          (this.gizmo.translate.visible = "translate" === this.mode),
            (this.gizmo.rotate.visible = "rotate" === this.mode),
            (this.gizmo.scale.visible = "scale" === this.mode),
            (this.helper.translate.visible = "translate" === this.mode),
            (this.helper.rotate.visible = "rotate" === this.mode),
            (this.helper.scale.visible = "scale" === this.mode);
          let i = [];
          (i = i.concat(this.picker[this.mode].children)),
            (i = i.concat(this.gizmo[this.mode].children)),
            (i = i.concat(this.helper[this.mode].children));
          for (let t = 0; t < i.length; t++) {
            const s = i[t];
            let a;
            if (
              ((s.visible = !0),
              s.rotation.set(0, 0, 0),
              s.position.copy(this.worldPosition),
              (a = this.camera.isOrthographicCamera
                ? (this.camera.top - this.camera.bottom) / this.camera.zoom
                : this.worldPosition.distanceTo(this.cameraPosition) *
                  Math.min(
                    (1.9 * Math.tan((Math.PI * this.camera.fov) / 360)) /
                      this.camera.zoom,
                    7
                  )),
              s.scale.set(1, 1, 1).multiplyScalar((a * this.size) / 7),
              "helper" !== s.tag)
            ) {
              if (
                (s.quaternion.copy(e),
                "translate" === this.mode || "scale" === this.mode)
              ) {
                const t = 0.99,
                  i = 0.2,
                  n = 0;
                ("X" !== s.name && "XYZX" !== s.name) ||
                  (Math.abs(y.copy(S).applyQuaternion(e).dot(this.eye)) > t &&
                    (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1))),
                  ("Y" !== s.name && "XYZY" !== s.name) ||
                    (Math.abs(y.copy(U).applyQuaternion(e).dot(this.eye)) > t &&
                      (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1))),
                  ("Z" !== s.name && "XYZZ" !== s.name) ||
                    (Math.abs(y.copy(T).applyQuaternion(e).dot(this.eye)) > t &&
                      (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1))),
                  "XY" === s.name &&
                    Math.abs(y.copy(T).applyQuaternion(e).dot(this.eye)) < i &&
                    (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1)),
                  "YZ" === s.name &&
                    Math.abs(y.copy(S).applyQuaternion(e).dot(this.eye)) < i &&
                    (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1)),
                  "XZ" === s.name &&
                    Math.abs(y.copy(U).applyQuaternion(e).dot(this.eye)) < i &&
                    (s.scale.set(1e-10, 1e-10, 1e-10), (s.visible = !1)),
                  -1 !== s.name.search("X") &&
                    (y.copy(S).applyQuaternion(e).dot(this.eye) < n
                      ? "fwd" === s.tag
                        ? (s.visible = !1)
                        : (s.scale.x *= -1)
                      : "bwd" === s.tag && (s.visible = !1)),
                  -1 !== s.name.search("Y") &&
                    (y.copy(U).applyQuaternion(e).dot(this.eye) < n
                      ? "fwd" === s.tag
                        ? (s.visible = !1)
                        : (s.scale.y *= -1)
                      : "bwd" === s.tag && (s.visible = !1)),
                  -1 !== s.name.search("Z") &&
                    (y.copy(T).applyQuaternion(e).dot(this.eye) < n
                      ? "fwd" === s.tag
                        ? (s.visible = !1)
                        : (s.scale.z *= -1)
                      : "bwd" === s.tag && (s.visible = !1));
              } else
                "rotate" === this.mode &&
                  (x.copy(e),
                  y.copy(this.eye).applyQuaternion(o.copy(e).invert()),
                  -1 !== s.name.search("E") &&
                    s.quaternion.setFromRotationMatrix(
                      E.lookAt(this.eye, v, U)
                    ),
                  "X" === s.name &&
                    (o.setFromAxisAngle(S, Math.atan2(-y.y, y.z)),
                    o.multiplyQuaternions(x, o),
                    s.quaternion.copy(o)),
                  "Y" === s.name &&
                    (o.setFromAxisAngle(U, Math.atan2(y.x, y.z)),
                    o.multiplyQuaternions(x, o),
                    s.quaternion.copy(o)),
                  "Z" === s.name &&
                    (o.setFromAxisAngle(T, Math.atan2(y.y, y.x)),
                    o.multiplyQuaternions(x, o),
                    s.quaternion.copy(o)));
              (s.visible =
                s.visible && (-1 === s.name.indexOf("X") || this.showX)),
                (s.visible =
                  s.visible && (-1 === s.name.indexOf("Y") || this.showY)),
                (s.visible =
                  s.visible && (-1 === s.name.indexOf("Z") || this.showZ)),
                (s.visible =
                  s.visible &&
                  (-1 === s.name.indexOf("E") ||
                    (this.showX && this.showY && this.showZ))),
                (s.material._opacity =
                  s.material._opacity || s.material.opacity),
                (s.material._color =
                  s.material._color || s.material.color.clone()),
                s.material.color.copy(s.material._color),
                (s.material.opacity = s.material._opacity),
                this.enabled
                  ? this.axis &&
                    (s.name === this.axis ||
                    this.axis.split("").some(function (t) {
                      return s.name === t;
                    })
                      ? ((s.material.opacity = 1),
                        s.material.color.lerp(new n.Color(1, 1, 1), 0.5))
                      : ((s.material.opacity *= 0.25),
                        s.material.color.lerp(new n.Color(1, 1, 1), 0.5)))
                  : ((s.material.opacity *= 0.5),
                    s.material.color.lerp(new n.Color(1, 1, 1), 0.5));
            } else
              (s.visible = !1),
                "AXIS" === s.name
                  ? (s.position.copy(this.worldPositionStart),
                    (s.visible = !!this.axis),
                    "X" === this.axis &&
                      (o.setFromEuler(b.set(0, 0, 0)),
                      s.quaternion.copy(e).multiply(o),
                      Math.abs(y.copy(S).applyQuaternion(e).dot(this.eye)) >
                        0.9 && (s.visible = !1)),
                    "Y" === this.axis &&
                      (o.setFromEuler(b.set(0, 0, Math.PI / 2)),
                      s.quaternion.copy(e).multiply(o),
                      Math.abs(y.copy(U).applyQuaternion(e).dot(this.eye)) >
                        0.9 && (s.visible = !1)),
                    "Z" === this.axis &&
                      (o.setFromEuler(b.set(0, Math.PI / 2, 0)),
                      s.quaternion.copy(e).multiply(o),
                      Math.abs(y.copy(T).applyQuaternion(e).dot(this.eye)) >
                        0.9 && (s.visible = !1)),
                    "XYZE" === this.axis &&
                      (o.setFromEuler(b.set(0, Math.PI / 2, 0)),
                      y.copy(this.rotationAxis),
                      s.quaternion.setFromRotationMatrix(E.lookAt(v, y, U)),
                      s.quaternion.multiply(o),
                      (s.visible = this.dragging)),
                    "E" === this.axis && (s.visible = !1))
                  : "START" === s.name
                  ? (s.position.copy(this.worldPositionStart),
                    (s.visible = this.dragging))
                  : "END" === s.name
                  ? (s.position.copy(this.worldPosition),
                    (s.visible = this.dragging))
                  : "DELTA" === s.name
                  ? (s.position.copy(this.worldPositionStart),
                    s.quaternion.copy(this.worldQuaternionStart),
                    r
                      .set(1e-10, 1e-10, 1e-10)
                      .add(this.worldPositionStart)
                      .sub(this.worldPosition)
                      .multiplyScalar(-1),
                    r.applyQuaternion(
                      this.worldQuaternionStart.clone().invert()
                    ),
                    s.scale.copy(r),
                    (s.visible = this.dragging))
                  : (s.quaternion.copy(e),
                    this.dragging
                      ? s.position.copy(this.worldPositionStart)
                      : s.position.copy(this.worldPosition),
                    this.axis && (s.visible = -1 !== this.axis.search(s.name)));
          }
          super.updateMatrixWorld(t);
        }
      }
      TransformControlsGizmo.prototype.isTransformControlsGizmo = !0;
      class TransformControlsPlane extends n.Mesh {
        constructor() {
          super(
            new n.PlaneGeometry(1e5, 1e5, 2, 2),
            new n.MeshBasicMaterial({
              visible: !1,
              wireframe: !0,
              side: n.DoubleSide,
              transparent: !0,
              opacity: 0.1,
              toneMapped: !1,
            })
          ),
            (this.type = "TransformControlsPlane");
        }
        updateMatrixWorld(t) {
          let e = this.space;
          switch (
            (this.position.copy(this.worldPosition),
            "scale" === this.mode && (e = "local"),
            j.copy(S).applyQuaternion("local" === e ? this.worldQuaternion : k),
            L.copy(U).applyQuaternion("local" === e ? this.worldQuaternion : k),
            R.copy(T).applyQuaternion("local" === e ? this.worldQuaternion : k),
            y.copy(L),
            this.mode)
          ) {
            case "translate":
            case "scale":
              switch (this.axis) {
                case "X":
                  y.copy(this.eye).cross(j), A.copy(j).cross(y);
                  break;
                case "Y":
                  y.copy(this.eye).cross(L), A.copy(L).cross(y);
                  break;
                case "Z":
                  y.copy(this.eye).cross(R), A.copy(R).cross(y);
                  break;
                case "XY":
                  A.copy(R);
                  break;
                case "YZ":
                  A.copy(j);
                  break;
                case "XZ":
                  y.copy(R), A.copy(L);
                  break;
                case "XYZ":
                case "E":
                  A.set(0, 0, 0);
              }
              break;
            case "rotate":
            default:
              A.set(0, 0, 0);
          }
          0 === A.length()
            ? this.quaternion.copy(this.cameraQuaternion)
            : (C.lookAt(r.set(0, 0, 0), A, y),
              this.quaternion.setFromRotationMatrix(C)),
            super.updateMatrixWorld(t);
        }
      }
      TransformControlsPlane.prototype.isTransformControlsPlane = !0;
    },
    84509: (t, e, i) => {
      "use strict";
      i.r(e), i.d(e, { encode: () => r });
      var n = i(48764).Buffer;
      function s(t) {
        Math.round;
        var e,
          i,
          s,
          r,
          a,
          o = Math.floor,
          l = new Array(64),
          h = new Array(64),
          d = new Array(64),
          c = new Array(64),
          u = new Array(65535),
          p = new Array(65535),
          f = new Array(64),
          _ = new Array(64),
          m = [],
          w = 0,
          g = 7,
          b = new Array(64),
          y = new Array(64),
          v = new Array(64),
          E = new Array(256),
          x = new Array(2048),
          k = [
            0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12,
            17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32,
            39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50,
            56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63,
          ],
          A = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
          C = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
          S = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
          U = [
            1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20,
            50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51,
            98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52,
            53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85,
            86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116,
            117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137,
            138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164,
            165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184,
            185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211,
            212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230,
            231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249,
            250,
          ],
          T = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
          j = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
          L = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
          R = [
            0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50,
            129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114,
            209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41,
            42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84,
            85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115,
            116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135,
            136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162,
            163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182,
            183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202,
            210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229,
            230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249,
            250,
          ];
        function O(t, e) {
          for (var i = 0, n = 0, s = new Array(), r = 1; r <= 16; r++) {
            for (var a = 1; a <= t[r]; a++)
              (s[e[n]] = []), (s[e[n]][0] = i), (s[e[n]][1] = r), n++, i++;
            i *= 2;
          }
          return s;
        }
        function I(t) {
          for (var e = t[0], i = t[1] - 1; i >= 0; )
            e & (1 << i) && (w |= 1 << g),
              i--,
              --g < 0 && (255 == w ? (P(255), P(0)) : P(w), (g = 7), (w = 0));
        }
        function P(t) {
          m.push(t);
        }
        function M(t) {
          P((t >> 8) & 255), P(255 & t);
        }
        function N(t) {
          t &&
            (M(65505),
            M(t.length + 2),
            (function (t) {
              for (var e = 0, i = t.length; e < i; e++) P(t.charCodeAt(e));
            })(t));
        }
        function z(t, e, i, n, s) {
          for (
            var r,
              a = s[0],
              o = s[240],
              l = (function (t, e) {
                var i,
                  n,
                  s,
                  r,
                  a,
                  o,
                  l,
                  h,
                  d,
                  c,
                  u = 0;
                for (d = 0; d < 8; ++d) {
                  (i = t[u]),
                    (n = t[u + 1]),
                    (s = t[u + 2]),
                    (r = t[u + 3]),
                    (a = t[u + 4]),
                    (o = t[u + 5]),
                    (l = t[u + 6]);
                  var p = i + (h = t[u + 7]),
                    _ = i - h,
                    m = n + l,
                    w = n - l,
                    g = s + o,
                    b = s - o,
                    y = r + a,
                    v = r - a,
                    E = p + y,
                    x = p - y,
                    k = m + g,
                    A = m - g;
                  (t[u] = E + k), (t[u + 4] = E - k);
                  var C = 0.707106781 * (A + x);
                  (t[u + 2] = x + C), (t[u + 6] = x - C);
                  var S = 0.382683433 * ((E = v + b) - (A = w + _)),
                    U = 0.5411961 * E + S,
                    T = 1.306562965 * A + S,
                    j = 0.707106781 * (k = b + w),
                    L = _ + j,
                    R = _ - j;
                  (t[u + 5] = R + U),
                    (t[u + 3] = R - U),
                    (t[u + 1] = L + T),
                    (t[u + 7] = L - T),
                    (u += 8);
                }
                for (u = 0, d = 0; d < 8; ++d) {
                  (i = t[u]),
                    (n = t[u + 8]),
                    (s = t[u + 16]),
                    (r = t[u + 24]),
                    (a = t[u + 32]),
                    (o = t[u + 40]),
                    (l = t[u + 48]);
                  var O = i + (h = t[u + 56]),
                    I = i - h,
                    P = n + l,
                    M = n - l,
                    N = s + o,
                    z = s - o,
                    D = r + a,
                    B = r - a,
                    Z = O + D,
                    F = O - D,
                    G = P + N,
                    H = P - N;
                  (t[u] = Z + G), (t[u + 32] = Z - G);
                  var W = 0.707106781 * (H + F);
                  (t[u + 16] = F + W), (t[u + 48] = F - W);
                  var X = 0.382683433 * ((Z = B + z) - (H = M + I)),
                    V = 0.5411961 * Z + X,
                    Y = 1.306562965 * H + X,
                    K = 0.707106781 * (G = z + M),
                    Q = I + K,
                    $ = I - K;
                  (t[u + 40] = $ + V),
                    (t[u + 24] = $ - V),
                    (t[u + 8] = Q + Y),
                    (t[u + 56] = Q - Y),
                    u++;
                }
                for (d = 0; d < 64; ++d)
                  (c = t[d] * e[d]),
                    (f[d] = c > 0 ? (c + 0.5) | 0 : (c - 0.5) | 0);
                return f;
              })(t, e),
              h = 0;
            h < 64;
            ++h
          )
            _[k[h]] = l[h];
          var d = _[0] - i;
          (i = _[0]), 0 == d ? I(n[0]) : (I(n[p[(r = 32767 + d)]]), I(u[r]));
          for (var c = 63; c > 0 && 0 == _[c]; c--);
          if (0 == c) return I(a), i;
          for (var m, w = 1; w <= c; ) {
            for (var g = w; 0 == _[w] && w <= c; ++w);
            var b = w - g;
            if (b >= 16) {
              m = b >> 4;
              for (var y = 1; y <= m; ++y) I(o);
              b &= 15;
            }
            (r = 32767 + _[w]), I(s[(b << 4) + p[r]]), I(u[r]), w++;
          }
          return 63 != c && I(a), i;
        }
        function D(t) {
          if ((t <= 0 && (t = 1), t > 100 && (t = 100), a != t)) {
            (function (t) {
              for (
                var e = [
                    16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60,
                    55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87,
                    80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64,
                    81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72,
                    92, 95, 98, 112, 100, 103, 99,
                  ],
                  i = 0;
                i < 64;
                i++
              ) {
                var n = o((e[i] * t + 50) / 100);
                n < 1 ? (n = 1) : n > 255 && (n = 255), (l[k[i]] = n);
              }
              for (
                var s = [
                    17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99,
                    99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99,
                    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
                    99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
                    99, 99, 99, 99,
                  ],
                  r = 0;
                r < 64;
                r++
              ) {
                var a = o((s[r] * t + 50) / 100);
                a < 1 ? (a = 1) : a > 255 && (a = 255), (h[k[r]] = a);
              }
              for (
                var u = [
                    1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958,
                    0.5411961, 0.275899379,
                  ],
                  p = 0,
                  f = 0;
                f < 8;
                f++
              )
                for (var _ = 0; _ < 8; _++)
                  (d[p] = 1 / (l[k[p]] * u[f] * u[_] * 8)),
                    (c[p] = 1 / (h[k[p]] * u[f] * u[_] * 8)),
                    p++;
            })(t < 50 ? Math.floor(5e3 / t) : Math.floor(200 - 2 * t)),
              (a = t);
          }
        }
        (this.encode = function (t, a) {
          new Date().getTime();
          var o = a.quality;
          o && D(o),
            (m = new Array()),
            (w = 0),
            (g = 7),
            M(65496),
            M(65504),
            M(16),
            P(74),
            P(70),
            P(73),
            P(70),
            P(0),
            P(1),
            P(1),
            P(0),
            M(1),
            M(1),
            P(0),
            P(0),
            N(a.exif),
            (function () {
              M(65499), M(132), P(0);
              for (var t = 0; t < 64; t++) P(l[t]);
              P(1);
              for (var e = 0; e < 64; e++) P(h[e]);
            })(),
            (function (t, e) {
              M(65472),
                M(17),
                P(8),
                M(e),
                M(t),
                P(3),
                P(1),
                P(17),
                P(0),
                P(2),
                P(17),
                P(1),
                P(3),
                P(17),
                P(1);
            })(t.width, t.height),
            (function () {
              M(65476), M(418), P(0);
              for (var t = 0; t < 16; t++) P(A[t + 1]);
              for (var e = 0; e <= 11; e++) P(C[e]);
              P(16);
              for (var i = 0; i < 16; i++) P(S[i + 1]);
              for (var n = 0; n <= 161; n++) P(U[n]);
              P(1);
              for (var s = 0; s < 16; s++) P(T[s + 1]);
              for (var r = 0; r <= 11; r++) P(j[r]);
              P(17);
              for (var a = 0; a < 16; a++) P(L[a + 1]);
              for (var o = 0; o <= 161; o++) P(R[o]);
            })(),
            M(65498),
            M(12),
            P(3),
            P(1),
            P(0),
            P(2),
            P(17),
            P(3),
            P(17),
            P(0),
            P(63),
            P(0);
          var u = 0,
            p = 0,
            f = 0;
          (w = 0), (g = 7), (this.encode.displayName = "_encode_");
          for (
            var _,
              E,
              k,
              O,
              B,
              Z,
              F,
              G,
              H,
              W = t.data,
              X = t.width,
              V = t.height,
              Y = a.flipY,
              K = 4 * X,
              Q = Y ? V : 0,
              $ = Y ? -8 : 8;
            (Y && Q > 0) || (!Y && Q < V);

          ) {
            for (_ = 0; _ < K; ) {
              for (Z = B = K * Q + _, F = -1, G = 0, H = 0; H < 64; H++)
                (Z = B + (G = (Y ? 63 - H : H) >> 3) * K + (F = 4 * (7 & H))),
                  Q + G >= V && (Z -= K * (Q + 1 + G - V)),
                  _ + F >= K && (Z -= _ + F - K + 4),
                  (E = W[Z++]),
                  (k = W[Z++]),
                  (O = W[Z++]),
                  (b[H] =
                    ((x[E] + x[(k + 256) >> 0] + x[(O + 512) >> 0]) >> 16) -
                    128),
                  (y[H] =
                    ((x[(E + 768) >> 0] +
                      x[(k + 1024) >> 0] +
                      x[(O + 1280) >> 0]) >>
                      16) -
                    128),
                  (v[H] =
                    ((x[(E + 1280) >> 0] +
                      x[(k + 1536) >> 0] +
                      x[(O + 1792) >> 0]) >>
                      16) -
                    128);
              (u = z(b, d, u, e, s)),
                (p = z(y, c, p, i, r)),
                (f = z(v, c, f, i, r)),
                (_ += 32);
            }
            Q += $;
          }
          if (g >= 0) {
            var q = [];
            (q[1] = g + 1), (q[0] = (1 << (g + 1)) - 1), I(q);
          }
          return M(65497), new n(m);
        }),
          (function () {
            new Date().getTime();
            t || (t = 50),
              (function () {
                for (var t = String.fromCharCode, e = 0; e < 256; e++)
                  E[e] = t(e);
              })(),
              (e = O(A, C)),
              (i = O(T, j)),
              (s = O(S, U)),
              (r = O(L, R)),
              (function () {
                for (var t = 1, e = 2, i = 1; i <= 15; i++) {
                  for (var n = t; n < e; n++)
                    (p[32767 + n] = i),
                      (u[32767 + n] = []),
                      (u[32767 + n][1] = i),
                      (u[32767 + n][0] = n);
                  for (var s = -(e - 1); s <= -t; s++)
                    (p[32767 + s] = i),
                      (u[32767 + s] = []),
                      (u[32767 + s][1] = i),
                      (u[32767 + s][0] = e - 1 + s);
                  (t <<= 1), (e <<= 1);
                }
              })(),
              (function () {
                for (var t = 0; t < 256; t++)
                  (x[t] = 19595 * t),
                    (x[(t + 256) >> 0] = 38470 * t),
                    (x[(t + 512) >> 0] = 7471 * t + 32768),
                    (x[(t + 768) >> 0] = -11059 * t),
                    (x[(t + 1024) >> 0] = -21709 * t),
                    (x[(t + 1280) >> 0] = 32768 * t + 8421375),
                    (x[(t + 1536) >> 0] = -27439 * t),
                    (x[(t + 1792) >> 0] = -5329 * t);
              })(),
              D(t),
              new Date().getTime();
          })();
      }
      function r(t, e) {
        return (
          ((e = e || {}).quality = e.quality || 50),
          (e.exif = e.exif || ""),
          {
            data: new s(e.quality).encode(t, e),
            width: t.width,
            height: t.height,
          }
        );
      }
    },
    89269: () => {
      !(function (t, e, i) {
        function n(t, e) {
          return typeof t === e;
        }
        function s() {
          return "function" != typeof e.createElement
            ? e.createElement(arguments[0])
            : d
            ? e.createElementNS.call(
                e,
                "http://www.w3.org/2000/svg",
                arguments[0]
              )
            : e.createElement.apply(e, arguments);
        }
        var r = [],
          a = [],
          o = {
            _version: "3.5.0",
            _config: {
              classPrefix: "",
              enableClasses: !0,
              enableJSClass: !0,
              usePrefixes: !0,
            },
            _q: [],
            on: function (t, e) {
              var i = this;
              setTimeout(function () {
                e(i[t]);
              }, 0);
            },
            addTest: function (t, e, i) {
              a.push({ name: t, fn: e, options: i });
            },
            addAsyncTest: function (t) {
              a.push({ name: null, fn: t });
            },
          },
          l = function () {};
        (l.prototype = o), (l = new l());
        var h = e.documentElement,
          d = "svg" === h.nodeName.toLowerCase();
        l.addTest("canvas", function () {
          var t = s("canvas");
          return !(!t.getContext || !t.getContext("2d"));
        });
        var c = (function () {
          var t = !("onblur" in e.documentElement);
          return function (e, n) {
            var r;
            return (
              !!e &&
              ((n && "string" != typeof n) || (n = s(n || "div")),
              !(r = (e = "on" + e) in n) &&
                t &&
                (n.setAttribute || (n = s("div")),
                n.setAttribute(e, ""),
                (r = "function" == typeof n[e]),
                n[e] !== i && (n[e] = i),
                n.removeAttribute(e)),
              r)
            );
          };
        })();
        o.hasEvent = c;
        var u = o._config.usePrefixes
          ? "Moz O ms Webkit".toLowerCase().split(" ")
          : [];
        (o._domPrefixes = u),
          l.addTest("pointerevents", function () {
            var t = !1,
              e = u.length;
            for (t = l.hasEvent("pointerdown"); e-- && !t; )
              c(u[e] + "pointerdown") && (t = !0);
            return t;
          }),
          (function () {
            var t, e, i, s, o, h;
            for (var d in a)
              if (a.hasOwnProperty(d)) {
                if (
                  ((t = []),
                  (e = a[d]).name &&
                    (t.push(e.name.toLowerCase()),
                    e.options && e.options.aliases && e.options.aliases.length))
                )
                  for (i = 0; i < e.options.aliases.length; i++)
                    t.push(e.options.aliases[i].toLowerCase());
                for (
                  s = n(e.fn, "function") ? e.fn() : e.fn, o = 0;
                  o < t.length;
                  o++
                )
                  1 === (h = t[o].split(".")).length
                    ? (l[h[0]] = s)
                    : (!l[h[0]] ||
                        l[h[0]] instanceof Boolean ||
                        (l[h[0]] = new Boolean(l[h[0]])),
                      (l[h[0]][h[1]] = s)),
                    r.push((s ? "" : "no-") + h.join("-"));
              }
          })(),
          (function (t) {
            var e = h.className,
              i = l._config.classPrefix || "";
            if ((d && (e = e.baseVal), l._config.enableJSClass)) {
              var n = new RegExp("(^|\\s)" + i + "no-js(\\s|$)");
              e = e.replace(n, "$1" + i + "js$2");
            }
            l._config.enableClasses &&
              ((e += " " + i + t.join(" " + i)),
              d ? (h.className.baseVal = e) : (h.className = e));
          })(r),
          delete o.addTest,
          delete o.addAsyncTest;
        for (var p = 0; p < l._q.length; p++) l._q[p]();
        t.Modernizr = l;
      })(window, document);
    },
    656: () => {
      !(function () {
        if (
          ("performance" in window == !1 && (window.performance = {}),
          (Date.now =
            Date.now ||
            function () {
              return new Date().getTime();
            }),
          "now" in window.performance == !1)
        ) {
          var t = Date.now();
          performance.timing &&
            performance.timing.navigationStart &&
            (t = performance.timing.navigationStart),
            (window.performance.now = function () {
              return Date.now() - t;
            });
        }
      })();
    },
    88175: (t, e, i) => {
      var n = {
        "./TransformControls.js": 27251,
        "./jpeg/jpeg_encoder.js": 84509,
        "./modernizr.js": 89269,
        "./performance-polyfill.js": 656,
        "./segment.js": 8243,
        "./webm-writer.js": 64875,
      };
      function s(t) {
        var e = r(t);
        return i(e);
      }
      function r(t) {
        if (!i.o(n, t)) {
          var e = new Error("Cannot find module '" + t + "'");
          throw ((e.code = "MODULE_NOT_FOUND"), e);
        }
        return n[t];
      }
      (s.keys = function () {
        return Object.keys(n);
      }),
        (s.resolve = r),
        (t.exports = s),
        (s.id = 88175);
    },
    90321: (t, e, i) => {
      var n = {
        "./animation/AnimationClipCreator.js": 57321,
        "./animation/CCDIKSolver.js": 8555,
        "./animation/MMDAnimationHelper.js": 68217,
        "./animation/MMDPhysics.js": 42064,
        "./cameras/CinematicCamera.js": 88854,
        "./controls/DeviceOrientationControls.js": 68081,
        "./controls/DragControls.js": 59582,
        "./controls/FirstPersonControls.js": 71360,
        "./controls/FlyControls.js": 12554,
        "./controls/OrbitControls.js": 52886,
        "./controls/PointerLockControls.js": 31211,
        "./controls/TrackballControls.js": 41410,
        "./csm/CSM.js": 18872,
        "./csm/CSMHelper.js": 56253,
        "./csm/CSMShader.js": 27118,
        "./csm/Frustum.js": 87468,
        "./curves/CurveExtras.js": 63737,
        "./curves/NURBSCurve.js": 20536,
        "./curves/NURBSSurface.js": 7441,
        "./curves/NURBSUtils.js": 79751,
        "./deprecated/Geometry.js": 36953,
        "./effects/AnaglyphEffect.js": 62392,
        "./effects/AsciiEffect.js": 52441,
        "./effects/OutlineEffect.js": 80716,
        "./effects/ParallaxBarrierEffect.js": 39623,
        "./effects/PeppersGhostEffect.js": 25667,
        "./effects/StereoEffect.js": 94787,
        "./environments/DebugEnvironment.js": 44145,
        "./environments/RoomEnvironment.js": 88599,
        "./exporters/ColladaExporter.js": 94817,
        "./exporters/DRACOExporter.js": 79299,
        "./exporters/GLTFExporter.js": 22509,
        "./exporters/MMDExporter.js": 34958,
        "./exporters/OBJExporter.js": 12317,
        "./exporters/PLYExporter.js": 25690,
        "./exporters/STLExporter.js": 4079,
        "./exporters/USDZExporter.js": 21659,
        "./geometries/BoxLineGeometry.js": 65637,
        "./geometries/ConvexGeometry.js": 10424,
        "./geometries/DecalGeometry.js": 64395,
        "./geometries/LightningStrike.js": 13400,
        "./geometries/ParametricGeometries.js": 94522,
        "./geometries/RoundedBoxGeometry.js": 71272,
        "./geometries/TeapotGeometry.js": 40893,
        "./helpers/LightProbeHelper.js": 45108,
        "./helpers/PositionalAudioHelper.js": 4370,
        "./helpers/RectAreaLightHelper.js": 64130,
        "./helpers/VertexNormalsHelper.js": 43718,
        "./helpers/VertexTangentsHelper.js": 33976,
        "./interactive/HTMLMesh.js": 55880,
        "./interactive/InteractiveGroup.js": 24041,
        "./interactive/SelectionBox.js": 78903,
        "./interactive/SelectionHelper.js": 19803,
        "./lights/LightProbeGenerator.js": 64579,
        "./lights/RectAreaLightUniformsLib.js": 91578,
        "./lines/Line2.js": 10107,
        "./lines/LineGeometry.js": 58723,
        "./lines/LineMaterial.js": 93411,
        "./lines/LineSegments2.js": 47796,
        "./lines/LineSegmentsGeometry.js": 80063,
        "./lines/Wireframe.js": 47019,
        "./lines/WireframeGeometry2.js": 3432,
        "./loaders/3DMLoader.js": 29145,
        "./loaders/3MFLoader.js": 89001,
        "./loaders/AMFLoader.js": 92298,
        "./loaders/BVHLoader.js": 3326,
        "./loaders/BasisTextureLoader.js": 66653,
        "./loaders/ColladaLoader.js": 28687,
        "./loaders/DDSLoader.js": 8162,
        "./loaders/DRACOLoader.js": 10338,
        "./loaders/EXRLoader.js": 68204,
        "./loaders/FBXLoader.js": 50652,
        "./loaders/GCodeLoader.js": 64013,
        "./loaders/GLTFLoader.js": 17047,
        "./loaders/HDRCubeTextureLoader.js": 31356,
        "./loaders/IFCLoader.js": 20510,
        "./loaders/KMZLoader.js": 23491,
        "./loaders/KTX2Loader.js": 1867,
        "./loaders/KTXLoader.js": 58613,
        "./loaders/LDrawLoader.js": 82652,
        "./loaders/LUT3dlLoader.js": 95980,
        "./loaders/LUTCubeLoader.js": 30824,
        "./loaders/LWOLoader.js": 20961,
        "./loaders/LottieLoader.js": 38210,
        "./loaders/MD2Loader.js": 46468,
        "./loaders/MDDLoader.js": 49338,
        "./loaders/MMDLoader.js": 54546,
        "./loaders/MTLLoader.js": 54864,
        "./loaders/NRRDLoader.js": 74878,
        "./loaders/NodeMaterialLoader.js": 52917,
        "./loaders/OBJLoader.js": 48840,
        "./loaders/PCDLoader.js": 40879,
        "./loaders/PDBLoader.js": 31231,
        "./loaders/PLYLoader.js": 46286,
        "./loaders/PRWMLoader.js": 81481,
        "./loaders/PVRLoader.js": 65575,
        "./loaders/RGBELoader.js": 45174,
        "./loaders/RGBMLoader.js": 7585,
        "./loaders/STLLoader.js": 36637,
        "./loaders/SVGLoader.js": 8867,
        "./loaders/TDSLoader.js": 41081,
        "./loaders/TGALoader.js": 13187,
        "./loaders/TTFLoader.js": 29966,
        "./loaders/VOXLoader.js": 52300,
        "./loaders/VRMLLoader.js": 17412,
        "./loaders/VRMLoader.js": 11115,
        "./loaders/VTKLoader.js": 76993,
        "./loaders/XYZLoader.js": 28748,
        "./loaders/lwo/IFFParser.js": 83592,
        "./loaders/lwo/LWO2Parser.js": 90577,
        "./loaders/lwo/LWO3Parser.js": 73737,
        "./math/Capsule.js": 75654,
        "./math/ColorConverter.js": 4127,
        "./math/ConvexHull.js": 98004,
        "./math/ImprovedNoise.js": 90151,
        "./math/Lut.js": 91346,
        "./math/MeshSurfaceSampler.js": 77310,
        "./math/OBB.js": 42088,
        "./math/Octree.js": 73070,
        "./math/SimplexNoise.js": 91474,
        "./misc/ConvexObjectBreaker.js": 97927,
        "./misc/GPUComputationRenderer.js": 99210,
        "./misc/Gyroscope.js": 51755,
        "./misc/MD2Character.js": 94575,
        "./misc/MD2CharacterComplex.js": 59598,
        "./misc/MorphAnimMesh.js": 66296,
        "./misc/MorphBlendMesh.js": 97874,
        "./misc/ProgressiveLightMap.js": 66878,
        "./misc/RollerCoaster.js": 96385,
        "./misc/TubePainter.js": 9800,
        "./misc/Volume.js": 28027,
        "./misc/VolumeSlice.js": 68483,
        "./modifiers/CurveModifier.js": 92285,
        "./modifiers/EdgeSplitModifier.js": 86025,
        "./modifiers/SimplifyModifier.js": 55258,
        "./modifiers/TessellateModifier.js": 1072,
        "./objects/Lensflare.js": 19973,
        "./objects/LightningStorm.js": 78323,
        "./objects/MarchingCubes.js": 51397,
        "./objects/Reflector.js": 64731,
        "./objects/ReflectorForSSRPass.js": 27395,
        "./objects/ReflectorRTT.js": 93134,
        "./objects/Refractor.js": 52753,
        "./objects/ShadowMesh.js": 43742,
        "./objects/Sky.js": 66895,
        "./objects/Water.js": 51143,
        "./objects/Water2.js": 91758,
        "./offscreen/jank.js": 48668,
        "./offscreen/offscreen.js": 49176,
        "./offscreen/scene.js": 53616,
        "./physics/AmmoPhysics.js": 35868,
        "./postprocessing/AdaptiveToneMappingPass.js": 67822,
        "./postprocessing/AfterimagePass.js": 220,
        "./postprocessing/BloomPass.js": 24532,
        "./postprocessing/BokehPass.js": 66038,
        "./postprocessing/ClearPass.js": 31334,
        "./postprocessing/CubeTexturePass.js": 79412,
        "./postprocessing/DotScreenPass.js": 32801,
        "./postprocessing/EffectComposer.js": 32903,
        "./postprocessing/FilmPass.js": 30122,
        "./postprocessing/GlitchPass.js": 81732,
        "./postprocessing/HalftonePass.js": 58927,
        "./postprocessing/LUTPass.js": 57558,
        "./postprocessing/MaskPass.js": 86552,
        "./postprocessing/OutlinePass.js": 68121,
        "./postprocessing/Pass.js": 20740,
        "./postprocessing/RenderPass.js": 86426,
        "./postprocessing/SAOPass.js": 33598,
        "./postprocessing/SMAAPass.js": 72844,
        "./postprocessing/SSAARenderPass.js": 13919,
        "./postprocessing/SSAOPass.js": 56,
        "./postprocessing/SSRPass.js": 93375,
        "./postprocessing/SSRrPass.js": 46818,
        "./postprocessing/SavePass.js": 22328,
        "./postprocessing/ShaderPass.js": 15980,
        "./postprocessing/TAARenderPass.js": 46945,
        "./postprocessing/TexturePass.js": 21808,
        "./postprocessing/UnrealBloomPass.js": 53020,
        "./renderers/CSS2DRenderer.js": 29276,
        "./renderers/CSS3DRenderer.js": 21564,
        "./renderers/Projector.js": 55040,
        "./renderers/SVGRenderer.js": 55858,
        "./shaders/ACESFilmicToneMappingShader.js": 72019,
        "./shaders/AfterimageShader.js": 63232,
        "./shaders/BasicShader.js": 26352,
        "./shaders/BleachBypassShader.js": 75026,
        "./shaders/BlendShader.js": 40245,
        "./shaders/BokehShader.js": 20887,
        "./shaders/BokehShader2.js": 61667,
        "./shaders/BrightnessContrastShader.js": 76554,
        "./shaders/ColorCorrectionShader.js": 11510,
        "./shaders/ColorifyShader.js": 12577,
        "./shaders/ConvolutionShader.js": 76869,
        "./shaders/CopyShader.js": 68546,
        "./shaders/DOFMipMapShader.js": 92216,
        "./shaders/DepthLimitedBlurShader.js": 16763,
        "./shaders/DigitalGlitch.js": 58265,
        "./shaders/DotScreenShader.js": 7794,
        "./shaders/FXAAShader.js": 45441,
        "./shaders/FilmShader.js": 91684,
        "./shaders/FocusShader.js": 47876,
        "./shaders/FreiChenShader.js": 79641,
        "./shaders/FresnelShader.js": 47499,
        "./shaders/GammaCorrectionShader.js": 64717,
        "./shaders/GodRaysShader.js": 38424,
        "./shaders/HalftoneShader.js": 65152,
        "./shaders/HorizontalBlurShader.js": 6311,
        "./shaders/HorizontalTiltShiftShader.js": 63486,
        "./shaders/HueSaturationShader.js": 98340,
        "./shaders/KaleidoShader.js": 1650,
        "./shaders/LuminosityHighPassShader.js": 60513,
        "./shaders/LuminosityShader.js": 83391,
        "./shaders/MirrorShader.js": 10246,
        "./shaders/NormalMapShader.js": 24817,
        "./shaders/ParallaxShader.js": 86419,
        "./shaders/PixelShader.js": 35102,
        "./shaders/RGBShiftShader.js": 11331,
        "./shaders/SAOShader.js": 79796,
        "./shaders/SMAAShader.js": 50897,
        "./shaders/SSAOShader.js": 66415,
        "./shaders/SSRShader.js": 25123,
        "./shaders/SSRrShader.js": 24290,
        "./shaders/SepiaShader.js": 38775,
        "./shaders/SobelOperatorShader.js": 21076,
        "./shaders/SubsurfaceScatteringShader.js": 26797,
        "./shaders/TechnicolorShader.js": 76471,
        "./shaders/ToneMapShader.js": 87743,
        "./shaders/ToonShader.js": 10512,
        "./shaders/TriangleBlurShader.js": 24784,
        "./shaders/UnpackDepthRGBAShader.js": 3789,
        "./shaders/VerticalBlurShader.js": 26442,
        "./shaders/VerticalTiltShiftShader.js": 98859,
        "./shaders/VignetteShader.js": 12385,
        "./shaders/VolumeShader.js": 54445,
        "./shaders/WaterRefractionShader.js": 82588,
        "./textures/FlakesTexture.js": 65372,
        "./utils/BufferGeometryUtils.js": 23678,
        "./utils/GeometryCompressionUtils.js": 41329,
        "./utils/GeometryUtils.js": 78469,
        "./utils/RoughnessMipmapper.js": 32055,
        "./utils/SceneUtils.js": 79493,
        "./utils/ShadowMapViewer.js": 22637,
        "./utils/SkeletonUtils.js": 60531,
        "./utils/UVsDebug.js": 25133,
        "./webxr/ARButton.js": 98541,
        "./webxr/VRButton.js": 77146,
        "./webxr/XRControllerModelFactory.js": 43356,
        "./webxr/XREstimatedLight.js": 91836,
        "./webxr/XRHandModelFactory.js": 97979,
        "./webxr/XRHandOculusMeshModel.js": 74161,
        "./webxr/XRHandPrimitiveModel.js": 84074,
      };
      function s(t) {
        var e = r(t);
        return i(e);
      }
      function r(t) {
        if (!i.o(n, t)) {
          var e = new Error("Cannot find module '" + t + "'");
          throw ((e.code = "MODULE_NOT_FOUND"), e);
        }
        return n[t];
      }
      (s.keys = function () {
        return Object.keys(n);
      }),
        (s.resolve = r),
        (t.exports = s),
        (s.id = 90321);
    },
    32653: (t, e, i) => {
      "use strict";
      i.d(e, { s: () => RoomMeshData });
      var n = i(32770);
      class RoomMeshData extends n.V {
        constructor() {
          super(),
            (this.name = "room-mesh-data"),
            (this.floors = new Set()),
            (this.rooms = new Set());
        }
      }
    },
    45277: (t, e, i) => {
      "use strict";
      i.r(e), i.d(e, { default: () => SceneModule });
      var n,
        s = i(47724),
        r = i(96909),
        a = i(11321),
        o = i(88512);
      !(function (t) {
        (t.CLICK = "INTERACTION.CLICK"),
          (t.HOVER = "INTERACTION.HOVER"),
          (t.DRAG = "INTERACTION.DRAG"),
          (t.DRAG_BEGIN = "INTERACTION.DRAG_BEGIN"),
          (t.DRAG_END = "INTERACTION.DRAG_END"),
          (t.POINTER_MOVE = "INTERACTION.POINTER_MOVE"),
          (t.POINTER_BUTTON = "INTERACTION.POINTER_BUTTON"),
          (t.SCROLL = "INTERACTION.SCROLL"),
          (t.KEY = "INTERACTION.KEY"),
          (t.LONG_PRESS_START = "INTERACTION.LONG_PRESS_START"),
          (t.LONG_PRESS_END = "INTERACTION.LONG_PRESS_END"),
          (t.MULTI_SWIPE = "INTERACTION.MULTI_SWIPE"),
          (t.MULTI_SWIPE_END = "INTERACTION.MULTI_SWIPE_END"),
          (t.PINCH = "INTERACTION.PINCH"),
          (t.PINCH_END = "INTERACTION.PINCH_END"),
          (t.ROTATE = "INTERACTION.ROTATE"),
          (t.ROTATE_END = "INTERACTION.ROTATE_END");
      })(n || (n = {}));
      const l = new o.Z("ScenePath");
      function h(t, e, i, n) {
        return `${t ? `${t.id}/` : ""}${e.id}/${i}/${n}`;
      }
      function d(t, e, i) {
        switch (
          ((i.node = e),
          (i.component = null),
          (i.type = null),
          (i.property = null),
          t.length)
        ) {
          case 3:
            (i.property = t[2]),
              (i.component = e.findComponentById(t[0])),
              (i.type = t[1]);
            break;
          case 2:
            (i.property = t[1]),
              (i.component = e.findComponentById(t[0])),
              (i.type = i.component ? p(i.property, i.component) : null);
        }
      }
      function c(t, e) {
        const i = t.split("/"),
          n = { node: null, component: null, type: null, property: null };
        return d.length > 0 && d(i, e, n), n;
      }
      function u(t, e) {
        const i = t.split("/"),
          n = { node: null, component: null, type: null, property: null };
        if (i.length > 0) {
          const t = e.findNodeById(i[0]);
          t && (i.splice(0, 1), d(i, t, n));
        }
        return n;
      }
      function p(t, e) {
        return t in e.outputs
          ? f.OUTPUT
          : e.inputs && t in e.inputs
          ? f.INPUT
          : t in e.events
          ? f.EVENT
          : e.emits && t in e.emits
          ? f.EMIT
          : null;
      }
      var f;
      !(function (t) {
        (t.OUTPUT = "output"),
          (t.INPUT = "input"),
          (t.EVENT = "event"),
          (t.EMIT = "emit");
      })(f || (f = {}));
      class PathBase {
        constructor(t) {
          (this.id = t.id),
            (this.type = t.type),
            (this.component = t.component),
            (this.node = t.node),
            (this.property = t.property);
        }
      }
      class OutputPath extends PathBase {
        constructor(t) {
          super(t), (this.output = t.property);
        }
        get() {
          const t = this.component.outputs;
          if (t && this.output && t[this.output]) return t[this.output];
          l.warn(`get called on path that does not exist "${this.output}"`);
        }
      }
      class InputPath extends PathBase {
        constructor(t) {
          super(t), (this.input = t.property);
        }
        get() {
          const t = this.component.inputs;
          if (t && this.input && this.input in t) return t[this.input];
          l.warn(`get called on component without input "${this.input}`);
        }
        set(t) {
          const e = this.component.inputs;
          e && this.input && this.input in e
            ? (e[this.input] = t)
            : l.warn(`set called on component without input "${this.input}"`);
        }
      }
      class EventPath extends PathBase {
        constructor(t) {
          super(t), (this.event = t.property);
        }
        get eventName() {
          return this.event;
        }
      }
      class EmitPath extends PathBase {
        constructor(t) {
          super(t), (this.emit = t.property);
        }
        get emitName() {
          return this.emit;
        }
      }
      function _(t) {
        return t.type === f.OUTPUT;
      }
      function m(t) {
        return t.type === f.INPUT;
      }
      function w(t) {
        return t.type === f.EVENT;
      }
      function g(t) {
        return t.type === f.EMIT;
      }
      var b = i(10757);
      class IdTracker {
        constructor() {
          this.ids = new Set();
        }
        reserve(t) {
          return !this.ids.has(t) && (this.ids.add(t), !0);
        }
        nextId() {
          let t;
          do {
            t = (0, b.O1)(4);
          } while (!this.isAvailable(t));
          return this.reserve(t), t;
        }
        release(t) {
          this.ids.delete(t);
        }
        isAvailable(t) {
          return !this.ids.has(t);
        }
      }
      const y = new o.Z("SceneComponentFactory");
      class ComponentBuilder {
        constructor() {
          (this.idTracker = new IdTracker()), (this.factories = {});
        }
        registerFactory(t, e) {
          return (
            !this.factories[t] &&
            (y.debug(`Component "${t}" registered`),
            (this.factories[t] = e),
            !0)
          );
        }
        newInstance(t, e, i, n, s, r) {
          const a = this.factories[t];
          if (!a) throw Error(`Unknown component "${t}"`);
          const o = a();
          return (
            (o.componentType = t),
            ComponentBuilder.setupInputs(o, r),
            ComponentBuilder.setupOutputs(o),
            ComponentBuilder.setupBind(o, this.idTracker, n, s),
            ComponentBuilder.setupEvents(o),
            ComponentBuilder.setupEmits(o),
            ComponentBuilder.setupBindEvent(o, this.idTracker, n, s),
            ComponentBuilder.setupNotify(o, i),
            ComponentBuilder.setupSpyOnEvent(o, this.idTracker, n, s),
            (o.context = e),
            o
          );
        }
        static setupInputs(t, e) {
          if (!t.inputs || 0 === Object.keys(t.inputs).length) return;
          t.inputs = (0, a.$)(t.inputs);
          const i = t.inputs;
          if (e) for (const t of Object.keys(e)) t in i && (i[t] = e[t]);
          for (const t of Object.keys(i)) {
            const e = i[t];
            e &&
              "object" == typeof e &&
              !Array.isArray(e) &&
              (i[t] = (0, a.$)(e));
          }
          return i;
        }
        static setupOutputs(t) {
          if (
            ((t.outputs = t.outputs || {}),
            t.outputs.hasOwnProperty("objectRoot"))
          )
            throw Error(
              "outputs.objectRoot is a reserved property of the outputs object"
            );
          if (t.outputs.hasOwnProperty("collider"))
            throw Error(
              "outputs.collider is a reserved property of the outputs object"
            );
          (t.outputs.objectRoot = t.outputs.objectRoot || null),
            (t.outputs.collider = t.outputs.collider || null),
            (t.outputs = (0, a.$)(t.outputs));
        }
        static setupBind(t, e, i, n) {
          const s = t.inputs;
          t.bind = s
            ? function (r, a, o) {
                if (
                  (y.warn(
                    "`SceneComponent.bind` has been deprecated. See `SceneObject.bindPath` for replacement functionality"
                  ),
                  !s || !(r in s))
                )
                  throw Error(r + " is not an input of the target component");
                const l = i.addPath({
                    id: "input-" + e.nextId(),
                    type: f.INPUT,
                    node: n,
                    component: t,
                    property: r,
                  }),
                  h = i.addPath({
                    id: "output-" + e.nextId(),
                    type: f.OUTPUT,
                    node: n,
                    component: a,
                    property: o,
                  });
                i.bindPath(l, h);
              }
            : function () {
                throw (
                  (y.warn(
                    "`SceneComponent.bind` has been deprecated. See `SceneObject.bindPath` for replacement functionality"
                  ),
                  Error("This component has no inputs, bind failed"))
                );
              };
        }
        static setupEvents(t) {
          const e = t.events || {};
          !(function (t, e) {
            for (const i of e) t[i] = !!t[i];
          })(e, Object.values(n)),
            (t.events = (0, a.$)(e));
        }
        static setupEmits(t) {
          const e = t.emits;
          e && Object.keys(e).length > 0 && (t.emits = (0, a.$)(e));
        }
        static setupBindEvent(t, e, i, n) {
          t.bindEvent = function (s, r, a) {
            if (
              (y.warn(
                "`SceneComponent.bindEvent` has been deprecated. See `SceneObject.bindPath` for replacement functionality"
              ),
              !(s in t.events))
            )
              throw Error(s + " is not supported by the target component");
            const o = i.addPath({
              id: "event-" + e.nextId(),
              type: f.EVENT,
              node: n,
              component: t,
              property: s,
            });
            v(r, a);
            const l = i.addPath({
              id: "emit-" + e.nextId(),
              type: f.EMIT,
              node: n,
              component: r,
              property: a,
            });
            i.bindPath(o, l);
          };
        }
        static setupNotify(t, e) {
          t.notify = function (i, n) {
            (t.emits && !t.emits[i]) || e.notify(t, { type: i, data: n });
          };
        }
        static setupSpyOnEvent(t, e, i, n) {
          t.spyOnEvent = function (s) {
            y.warn(
              "`SceneComponent.spyOnEvent` has been deprecated. See `SceneObject.spyOnEvent` for replacement functionality"
            ),
              v(t, s.eventType);
            const r = i.addPath({
              id: "event-spy-" + e.nextId(),
              type: f.EMIT,
              node: n,
              component: t,
              property: s.eventType,
            });
            return i.spyOnEvent({ path: r, onEvent: s.onEvent.bind(s) });
          };
        }
      }
      function v(t, e) {
        const i = t.emits;
        (i && i.isObservableProxy) || ((t.emits = i || {}), (t.emits[e] = !0));
      }
      class ComponentEventBus {
        constructor() {
          this.observers = new Map();
        }
        notify(t, e) {
          const i = this.observers.get(t);
          if (i) {
            const t = i.get(e.type);
            if (t) for (const i of t) i.onEvent(i.targetEventType, e.data);
          }
        }
        observe(t) {
          const e = this.observers.get(t.src) || new Map();
          this.observers.set(t.src, e);
          const i = e.get(t.srcEventType) || new Set();
          e.set(t.srcEventType, i), i.add(t);
          const n = this;
          return {
            cancel() {
              n.removeObserver(t);
            },
          };
        }
        removeObserver(t) {
          const { src: e, srcEventType: i } = t,
            n = this.observers.get(e);
          if (n) {
            const e = n.get(i);
            e && e.delete(t);
          }
        }
      }
      var E = i(2212);
      class CwfComponent {
        constructor(t, e, i) {
          (this.instance = t),
            (this.onBeforeRender = e),
            (this.analytics = i),
            (this.state = null),
            (this.inputsCache = null),
            (this.dirty = !1),
            (this.interactionQueue = []),
            (this.onDataChanged = this.onDataChanged.bind(this));
        }
        init() {}
        beforeRender(t) {
          if ((this.onBeforeRender.update(), this.instance.onEvent))
            for (; this.interactionQueue.length > 0; ) {
              const t = this.interactionQueue.shift();
              t && this.instance.onEvent(t.type, t.data);
            }
          this.dirty &&
            this.instance.onInputsUpdated &&
            this.inputsCache &&
            (this.instance.onInputsUpdated(this.inputsCache),
            Object.assign(this.inputsCache, this.instance.inputs),
            (this.dirty = !1)),
            this.instance.onTick && this.instance.onTick(t);
        }
        render(t) {}
        dispose() {
          this.state && this.state.removeOnChanged(this.onDataChanged);
        }
        activate() {
          const t = this.instance.inputs;
          t &&
            (t.onChanged(this.onDataChanged),
            (this.inputsCache = Object.assign({}, t))),
            this.instance.onInit && this.instance.onInit();
          const e = { componentType: this.instance.componentType };
          this.analytics.track(
            "sdk_component_start",
            this.instance.componentType,
            e
          );
        }
        deactivate() {
          const t = this.instance.inputs;
          t && t.removeOnChanged(this.onDataChanged),
            this.instance.onDestroy && this.instance.onDestroy();
        }
        onDataChanged() {
          this.dirty = !0;
        }
        onEvent(t) {
          this.interactionQueue.push(t);
        }
      }
      var x = i(67627),
        k = i(35003),
        A = i(94610),
        C = i(51869),
        S = i(24764);
      class ProxyFactory {
        constructor(t) {
          this.propertyAccessor = t;
        }
        create(t, e) {
          return this._createProxy(t, (i) => {
            const n = this.propertyAccessor;
            return {
              get: () => (n.onAccess(e, i), t[i]),
              set: (s) => (n.onAccess(e, i), (t[i] = s), s),
            };
          });
        }
        createReadonly(t, e) {
          return this._createProxy(t, (i) => {
            const n = this.propertyAccessor;
            return { get: () => (n.onAccess(e, i), t[i]) };
          });
        }
        _createProxy(t, e) {
          const i = {};
          for (const n in t)
            t.hasOwnProperty(n) && Object.defineProperty(i, n, e(n));
          return i;
        }
      }
      var U = i(44283);
      const T = new o.Z("SceneNode");
      var j;
      !(function (t) {
        (t[(t.Idle = 0)] = "Idle"),
          (t[(t.Operating = 1)] = "Operating"),
          (t[(t.Stopped = 2)] = "Stopped");
      })(j || (j = {}));
      class SceneNode {
        constructor(t, e, i, n, s, r, a, o, l, h) {
          (this.componentLoader = t),
            (this.renderer = e),
            (this.targets = i),
            (this.analytics = n),
            (this.componentFactory = s),
            (this.sceneObject = r),
            (this.eventBus = a),
            (this.inputIni = o),
            (this.sceneNodeFactory = h),
            (this.obj3D = new E.Object3D()),
            (this.state = j.Idle),
            (this.components = []),
            (this.interactionsSubs = []),
            (this.idTracker = new IdTracker()),
            (this.proxyFactory = new ProxyFactory(l));
        }
        *componentIterator() {
          for (const t of this.components) yield t.instance;
        }
        *bindings() {
          for (const t of this.sceneObject.bindings()) {
            const [e] = t;
            e.node.id === this.id && (yield t);
          }
        }
        findComponentById(t) {
          const e = this.components.find((e) => e.instance.id === t);
          return e ? e.instance : null;
        }
        addObject(t) {
          return this.obj3D.add(t), t;
        }
        removeObject(t) {
          this.obj3D.remove(t);
        }
        addCollider(t) {
          return this.targets.addTarget(t, !1), t;
        }
        removeCollider(t) {
          this.targets.removeTarget(t);
        }
        get name() {
          return this.obj3D.name || "";
        }
        set name(t) {
          this.obj3D.name = t;
        }
        get position() {
          return this.obj3D.position;
        }
        get quaternion() {
          return this.obj3D.quaternion;
        }
        get scale() {
          return this.obj3D.scale;
        }
        addComponent(t, e, i) {
          if (this.state !== j.Idle)
            return (
              T.warn("Cannot add component after the node has started"), null
            );
          const n = {
            three: this.proxyFactory.createReadonly(E, "three"),
            renderer: this.proxyFactory.create(
              this.renderer.cwfRenderer.renderer,
              "renderer"
            ),
            scene: this.renderer.getScene().scene,
            camera: this.renderer.getScene().camera,
            nodeFactory: this.sceneNodeFactory,
            root: this,
          };
          const s = this.componentFactory.newInstance(
              t,
              n,
              this.eventBus,
              this.sceneObject,
              this,
              e
            ),
            r = new CwfComponent(
              s,
              new (class MatrixWorldUpdater {
                constructor(t) {
                  this.sceneNode = t;
                }
                update() {
                  this.sceneNode.obj3D.updateMatrixWorld();
                }
              })(this),
              this.analytics
            );
          this.components.push(r);
          const a = s.outputs;
          this.subscribeToObjectOutput(a);
          const o = this.subscribeToInteraction(r, s);
          if ((this.interactionsSubs.push(o), i)) {
            if (!this.idTracker.isAvailable(i))
              throw Error("Component with duplicate id detected.");
            if (-1 !== i.indexOf("/"))
              throw Error('Component ids cannot have "/" character.');
            this.idTracker.reserve(i);
          }
          const l = i || this.idTracker.nextId();
          return (
            Object.defineProperty(s, "id", {
              value: l,
              writable: !1,
              enumerable: !0,
            }),
            s
          );
        }
        subscribeToObjectOutput(t) {
          let e;
          t.onPropertyChanged("objectRoot", () => {
            e && (this.removeObject(e), (e = void 0)),
              t.objectRoot instanceof E.Object3D
                ? (e = this.addObject(t.objectRoot))
                : t.objectRoot &&
                  T.warn("outputs.object is not an instanceof THREE.Object3D");
          });
        }
        subscribeToInteraction(t, e) {
          let i, s;
          const r = e.outputs,
            a = () => {
              if ((i && (this.removeCollider(i), (i = void 0)), s)) {
                for (const t of s) t.cancel();
                s = void 0;
              }
            },
            o = () => {
              a(),
                r.collider instanceof E.Object3D
                  ? ((i = this.addCollider(r.collider)),
                    (s = this.registerInput(t, r.collider, e.events)))
                  : r.collider &&
                    T.warn(
                      "outputs.collider is not an instanceof THREE.Object3D"
                    );
            };
          return (
            e.events.onPropertyChanged(n.CLICK, o),
            e.events.onPropertyChanged(n.HOVER, o),
            e.events.onPropertyChanged(n.DRAG, o),
            r.onPropertyChanged("collider", o),
            (0, U.k1)(
              () => {},
              () => a()
            )
          );
        }
        registerInput(t, e, i) {
          const s = (e, i, n, s) => {
              const r = SceneNode.inputEventMap.get(
                Object.getPrototypeOf(e).constructor
              );
              if (r) {
                const a = {
                  type: r,
                  data: Object.assign(s || {}, {
                    collider: i,
                    point: n ? n.point : null,
                    normal: n && n.face ? n.face.normal : null,
                    input: e,
                  }),
                };
                t.onEvent(a);
              }
            },
            r = S.s.is((t) => (t === e && t.visible) || L(e)(t)),
            a = [];
          return (
            i[n.CLICK] && a.push(this.inputIni.registerMeshHandler(k.R, r, s)),
            i[n.HOVER] &&
              a.push(
                this.inputIni.registerMeshHandler(A.z, r, (t, e, i) => {
                  s(t, e, i, { hover: !0 });
                }),
                this.inputIni.registerMeshHandler(A.A, r, (t, e, i) => {
                  s(t, e, i, { hover: !1 });
                })
              ),
            i[n.DRAG] &&
              a.push(
                this.inputIni.registerMeshHandler(C.E0, r, s),
                this.inputIni.registerMeshHandler(C._t, r, s),
                this.inputIni.registerMeshHandler(C._R, r, s)
              ),
            a
          );
        }
        start() {
          if (this.state === j.Idle) {
            this.obj3D.parent ||
              this.renderer.getScene().addChild(x.a.Root, this.obj3D);
            for (const t of this.components)
              this.componentLoader.addComponent(t);
            this.state = j.Operating;
          }
        }
        stop() {
          if (this.state === j.Operating) {
            for (const t of this.interactionsSubs) t.cancel();
            this.interactionsSubs = [];
            for (const t of this.components)
              this.componentLoader.removeComponent(t);
            this.obj3D.parent && this.obj3D.parent.remove(this.obj3D),
              (this.state = j.Stopped);
          }
        }
      }
      SceneNode.inputEventMap = new Map([
        [k.R, n.CLICK],
        [A.z, n.HOVER],
        [A.A, n.HOVER],
        [C._t, n.DRAG],
        [C.E0, n.DRAG_BEGIN],
        [C._R, n.DRAG_END],
      ]);
      const L = (t) => (e) => {
        for (let i = e; i; i = i.parent) {
          if (!i.visible) return !1;
          if (t === i.parent) return !0;
        }
        return !1;
      };
      var R = i(48840),
        O = i(54864);
      class OBJLoader2Component {
        async load(t, e) {
          let i = null;
          if (e) {
            const t = new O.MTLLoader();
            i = await ((n = t),
            (s = e),
            new Promise((t, e) => {
              n.load(
                s,
                function (e) {
                  t(e);
                },
                void 0,
                e
              );
            }));
          }
          var n, s;
          const r = new R.OBJLoader();
          i && r.setMaterials(i);
          const a = await ((t, e) =>
            new Promise((i, n) => {
              t.load(
                e,
                function (t) {
                  i(t);
                },
                void 0,
                n
              );
            }))(r, t);
          return (
            a.traverse((t) => {
              if ("Mesh" === t.type) {
                const e = t;
                (e.castShadow = !0), (e.receiveShadow = !0);
              }
            }),
            { objectRoot: a, collider: a }
          );
        }
      }
      OBJLoader2Component.factoryName = "mp.objLoader";
      var I = i(50652);
      class FBXLoaderComponent {
        async load(t, e) {
          const i = new I.FBXLoader(),
            n = await ((t, e) =>
              new Promise((i, n) => {
                t.load(
                  e,
                  function (t) {
                    i(t);
                  },
                  void 0,
                  n
                );
              }))(i, t);
          return (
            n.traverse((t) => {
              if ("Mesh" === t.type) {
                const e = t;
                (e.castShadow = !0), (e.receiveShadow = !0);
              }
            }),
            { objectRoot: n, collider: n }
          );
        }
      }
      FBXLoaderComponent.factoryName = "mp.fbxLoader";
      var P = i(28687);
      class ColladaLoaderComponent {
        async load(t, e) {
          const i = new P.ColladaLoader(),
            n = await ((t, e) =>
              new Promise((i, n) => {
                t.load(
                  e,
                  function (t) {
                    i(t);
                  },
                  void 0,
                  n
                );
              }))(i, t);
          return (
            n.scene.traverse((t) => {
              if ("Mesh" === t.type) {
                const e = t;
                (e.castShadow = !0), (e.receiveShadow = !0);
              }
            }),
            { objectRoot: n.scene, collider: n.scene }
          );
        }
      }
      ColladaLoaderComponent.factoryName = "mp.daeLoader";
      var M = i(17047);
      class GLTFLoaderComponent {
        async load(t, e) {
          const i = new M.GLTFLoader(),
            n = await ((t, e) =>
              new Promise((i, n) => {
                t.load(
                  e,
                  function (t) {
                    i(t);
                  },
                  void 0,
                  n
                );
              }))(i, t);
          return (
            n.scene.traverse((t) => {
              if ("Mesh" === t.type) {
                const e = t;
                (e.castShadow = !0), (e.receiveShadow = !0);
              }
            }),
            { objectRoot: n.scene, collider: n.scene }
          );
        }
      }
      GLTFLoaderComponent.factoryName = "mp.gltfLoader";
      var N,
        z = i(27251);
      !(function (t) {
        (t.Translate = "translate"), (t.Rotate = "rotate"), (t.scale = "scale");
      })(N || (N = {}));
      class TransformControlsComponent {
        constructor() {
          (this.controlsSubs = []),
            (this.inputs = {
              visible: !0,
              selection: null,
              mode: N.Translate,
              showX: !0,
              showY: !0,
              showZ: !0,
              size: 1,
            }),
            (this.events = { [n.HOVER]: !1, [n.DRAG]: !0, [n.CLICK]: !1 });
        }
        onInit() {
          (this.transformControls = new z.TransformControls(
            this.context.camera,
            this.context.renderer.domElement
          )),
            (this.transformControls.enabled = !0),
            (this.outputs.objectRoot = this.transformControls),
            (this.collider = this.transformControls.children[0]),
            this.onInputsUpdated();
        }
        onEvent() {}
        onInputsUpdated() {
          if (this.inputs.selection) {
            const t = this.inputs.selection.obj3D;
            this.transformControls.attach(t),
              (this.outputs.collider = this.collider);
          } else
            this.transformControls.detach(), (this.outputs.collider = null);
          this.handleMode();
        }
        onDestroy() {
          for (const t of this.controlsSubs) t.cancel();
          (this.outputs.objectRoot = null), this.transformControls.dispose();
        }
        handleMode() {
          this.transformControls.mode !== this.inputs.mode &&
            this.transformControls.setMode(this.inputs.mode),
            (this.transformControls.showX = this.inputs.showX),
            (this.transformControls.showY = this.inputs.showY),
            (this.transformControls.showZ = this.inputs.showZ),
            (this.transformControls.size = this.inputs.size);
        }
      }
      (TransformControlsComponent.factory = () =>
        new TransformControlsComponent()),
        (TransformControlsComponent.factoryName = "mp.transformControls");
      i(35666);
      const D = i(90321),
        B = [];
      D.keys().forEach((t) => {
        B.push(D(t));
      });
      const Z = i(88175);
      B.push(Z("./TransformControls.js"));
      var F = i(13187);
      class ScrollingTube {
        constructor() {
          (this.visibleCache = !0),
            (this.lengthCache = 1),
            (this.radiusCache = 0.5),
            (this.fillColorCache = "rgba(0,255,0,0.3)"),
            (this.textColorCache = "rgb(0,255,0)"),
            (this.textCache = "➡︎"),
            (this.fontCache = "48px sans-serif"),
            (this.mesh = null),
            (this.material = null),
            (this.geometry = null),
            (this.texture = null),
            (this.time = 0),
            (this.inputs = {
              visible: !0,
              length: 1,
              radius: 0.5,
              fillColor: "rgba(0,255,0,0.3)",
              textColor: "rgb(255,255,255)",
              text: "➡︎",
              font: "48px sans-serif",
              scrollSpeed: 1,
            });
        }
        onInit() {
          this.updateCache(), this.makeTube();
        }
        onInputsUpdated() {
          (this.inputs.length === this.lengthCache &&
            this.inputs.radius === this.radiusCache &&
            this.inputs.fillColor === this.fillColorCache &&
            this.inputs.textColor === this.textColorCache &&
            this.inputs.text === this.textCache &&
            this.inputs.font === this.fontCache) ||
            (this.updateCache(), this.makeTube()),
            this.visibleCache !== this.inputs.visible &&
              ((this.visibleCache = this.inputs.visible),
              this.mesh && (this.mesh.visible = this.inputs.visible));
        }
        onDestroy() {
          this.releaseTube();
        }
        updateCache() {
          (this.radiusCache = this.inputs.radius),
            (this.lengthCache = this.inputs.length),
            (this.fillColorCache = this.inputs.fillColor),
            (this.textColorCache = this.inputs.textColor),
            (this.textCache = this.inputs.text),
            (this.fontCache = this.inputs.font);
        }
        makeTube() {
          this.releaseTube();
          const t = document.createElement("canvas").getContext("2d");
          if (!t) return;
          (t.canvas.width = 64),
            (t.canvas.height = 64),
            (t.fillStyle = this.inputs.fillColor),
            t.fillRect(0, 0, 64, 64),
            t.translate(32, 32),
            t.rotate(0.5 * Math.PI),
            (t.fillStyle = this.inputs.textColor),
            (t.textAlign = "center"),
            (t.textBaseline = "middle"),
            (t.font = this.inputs.font),
            t.fillText(this.inputs.text, 0, 0),
            (this.texture = new E.CanvasTexture(t.canvas)),
            (this.texture.wrapS = E.RepeatWrapping),
            (this.texture.wrapT = E.RepeatWrapping),
            (this.texture.repeat.x = 4),
            (this.texture.repeat.y =
              this.inputs.length / (2 * this.inputs.radius));
          const e = new E.CylinderBufferGeometry(
            this.inputs.radius,
            this.inputs.radius,
            this.inputs.length,
            20,
            2,
            !0
          );
          (this.material = new E.MeshBasicMaterial({
            map: this.texture,
            depthWrite: !1,
            depthTest: !1,
            transparent: !0,
          })),
            (this.outputs.objectRoot = new E.Mesh(e, this.material));
        }
        onTick(t) {
          (this.time += t),
            this.texture &&
              (this.texture.offset.y =
                ((this.inputs.scrollSpeed * this.time) / 1e3) % 1);
        }
        releaseTube() {
          this.material && (this.material.dispose(), (this.material = null)),
            this.geometry && (this.geometry.dispose(), (this.geometry = null)),
            this.texture && (this.texture.dispose(), (this.texture = null)),
            (this.mesh = null);
        }
      }
      (ScrollingTube.factory = () => new ScrollingTube()),
        (ScrollingTube.factoryName = "mp.scrollingTube");
      var G,
        H = i(17399);
      !(function (t) {
        (t.Scene = "scene"),
          (t.Model = "model"),
          (t.Floor = "floor"),
          (t.Room = "room");
      })(G || (G = {}));
      class Tags {
        constructor() {
          (this.tagMap = new Map()), (this.tmpSet = new Set());
        }
        tagObject(t, e) {
          for (const i of e) {
            let e = this.tagMap.get(i);
            e || ((e = []), this.tagMap.set(i, e));
            e.find((e) => e === t) || e.push(t);
          }
        }
        untagObject(t, e) {
          for (const i of e) {
            const e = this.tagMap.get(i);
            if (e) {
              const i = e.findIndex((e) => e === t);
              -1 !== i && e.splice(i);
            }
          }
        }
        getObjects(t) {
          this.tmpSet.clear();
          const e = [];
          for (const i of t) {
            const t = this.tagMap.get(i);
            if (t)
              for (const i of t)
                this.tmpSet.has(i) || (e.push(i), this.tmpSet.add(i));
          }
          return e;
        }
      }
      class LightsComponents {
        onInit() {
          const t = new E.Object3D(),
            e = new E.AmbientLight(8947848),
            i = new E.DirectionalLight(14540253, 1);
          i.position.set(1, 0.5, 1),
            t.add(e),
            t.add(i),
            (this.outputs.objectRoot = t);
        }
      }
      (LightsComponents.factory = () => new LightsComponents()),
        (LightsComponents.factoryName = "mp.lights");
      var W = i(23847);
      class PointLightComponent {
        constructor() {
          this.inputs = {
            enabled: !0,
            color: { r: 1, g: 1, b: 1 },
            intensity: 2,
            position: { x: 1, y: 5, z: 1 },
            distance: 0,
            decay: 1,
            castShadow: !1,
            debug: !1,
          };
        }
        onInit() {
          (this.light = new E.PointLight()),
            (this.lightHelper = new E.PointLightHelper(this.light, 1));
          const t = new E.Group();
          t.add(this.light),
            t.add(this.lightHelper),
            this.onInputsUpdated(),
            (this.outputs.objectRoot = t);
        }
        onInputsUpdated() {
          (this.light.visible = this.inputs.enabled),
            (this.lightHelper.visible = this.inputs.debug),
            this.light.visible &&
              (this.light.position.set(
                this.inputs.position.x,
                this.inputs.position.y,
                this.inputs.position.z
              ),
              this.light.color.setRGB(
                this.inputs.color.r,
                this.inputs.color.g,
                this.inputs.color.b
              ),
              (this.light.intensity = this.inputs.intensity),
              (this.light.distance = this.inputs.distance),
              (this.light.decay = this.inputs.decay),
              (this.light.castShadow = this.inputs.castShadow));
        }
        onDestroyed() {
          this.lightHelper.dispose(), (this.outputs.objectRoot = null);
        }
        onTick() {
          this.inputs.debug && this.lightHelper.update();
        }
      }
      (PointLightComponent.factory = () => new PointLightComponent()),
        (PointLightComponent.factoryName = "mp.pointLight");
      class DirectionalLightComponent {
        constructor() {
          this.inputs = {
            enabled: !0,
            color: { r: 1, g: 1, b: 1 },
            intensity: 2,
            position: { x: 1, y: 5, z: 1 },
            target: { x: 0, y: 0, z: 0 },
            castShadow: !1,
            debug: !1,
          };
        }
        onInit() {
          (this.targetObject = new E.Object3D()),
            (this.light = new E.DirectionalLight()),
            (this.light.target = this.targetObject),
            (this.light.castShadow = !0),
            (this.lightHelper = new E.DirectionalLightHelper(this.light, 1));
          const t = new E.Group();
          t.add(this.light),
            t.add(this.targetObject),
            t.add(this.lightHelper),
            this.onInputsUpdated(),
            (this.outputs.objectRoot = t);
        }
        onInputsUpdated(t = null) {
          (this.light.visible = this.inputs.enabled),
            (this.lightHelper.visible = this.inputs.debug),
            this.inputs.enabled &&
              (this.targetObject.position.set(
                this.inputs.target.x,
                this.inputs.target.y,
                this.inputs.target.z
              ),
              this.light.position.set(
                this.inputs.position.x,
                this.inputs.position.y,
                this.inputs.position.z
              ),
              this.light.color.setRGB(
                this.inputs.color.r,
                this.inputs.color.g,
                this.inputs.color.b
              ),
              (this.light.intensity = this.inputs.intensity),
              (this.light.castShadow = this.inputs.castShadow));
        }
        onTick(t) {
          this.inputs.debug && this.lightHelper.update();
        }
        onDestroyed() {
          this.lightHelper.dispose(), (this.outputs.objectRoot = null);
        }
      }
      (DirectionalLightComponent.factory = () =>
        new DirectionalLightComponent()),
        (DirectionalLightComponent.factoryName = "mp.directionalLight");
      class AmbientLightComponent {
        constructor() {
          this.inputs = {
            enabled: !0,
            color: { r: 0.2, g: 0.2, b: 0.2 },
            intensity: 1,
          };
        }
        onInit() {
          (this.light = new E.AmbientLight()),
            this.onInputsUpdated(),
            (this.outputs.objectRoot = this.light);
        }
        onInputsUpdated() {
          this.light.color.setRGB(
            this.inputs.color.r,
            this.inputs.color.g,
            this.inputs.color.b
          ),
            (this.light.intensity = this.inputs.intensity),
            (this.light.visible = this.inputs.enabled);
        }
        onDestroyed() {
          this.outputs.objectRoot = null;
        }
      }
      (AmbientLightComponent.factory = () => new AmbientLightComponent()),
        (AmbientLightComponent.factoryName = "mp.ambientLight");
      var X = i(13377);
      class SceneAnalytics {
        constructor(t, e) {
          (this.analytics = t),
            (this.sdkData = e),
            (this.track = async (t, e) => {
              const i = Object.assign(e || {}, {
                applicationKey: this.sdkData.applicationKey,
              });
              this.analytics.track(t, i);
            });
        }
      }
      class TrackFirstPropertyAnalyticsWrapper {
        constructor(t) {
          (this.analytics = t), (this.trackedProperties = {});
        }
        onAccess(t, e) {
          if (this.trackedProperties[String(e)]) return;
          this.trackedProperties[String(e)] = !0;
          const i = { name: t, property: e };
          this.analytics.track("context-usage", i);
        }
      }
      class TrackFirstKeyAnalytics {
        constructor(t) {
          (this.analytics = t), (this.trackedKeys = {});
        }
        track(t, e, i) {
          this.trackedKeys[String(e)] ||
            ((this.trackedKeys[String(e)] = !0), this.analytics.track(t, i));
        }
      }
      var V = i(94656),
        Y = i(20331);
      class ImageLoader extends E.Loader {
        constructor(t, e) {
          super(),
            (this.renderer = t),
            (this.requestq = new Y.RequestQueue()),
            (this.worker = e());
        }
        load(t, e) {
          const i = new E.Texture();
          return (
            this.requestImage(t).then(async (t) => {
              this.updateTexture(i, t), e && e(i);
            }),
            i
          );
        }
        async loadAsync(t) {
          const e = await this.requestImage(t),
            i = await this.worker.exec(e, [e]),
            n = new E.DataTexture(
              new Uint8ClampedArray(i.width),
              i.width,
              i.height
            );
          return (
            (n.format = this.getPixelFormat(i)), this.prerenderTexture(n), n
          );
        }
        requestImage(t) {
          return this.requestq.get(t, { responseType: "arraybuffer" });
        }
        async updateTexture(t, e) {
          const i = await this.worker.exec(e, [e]);
          (t.format = this.getPixelFormat(i)),
            (function (t, e) {
              (t.image = {
                data: new Uint8Array(e.data),
                height: e.height,
                width: e.width,
              }),
                (t.isDataTexture = !0);
            })(t, i),
            this.prerenderTexture(t);
        }
        getPixelFormat(t) {
          const e = t.data.byteLength / (t.width * t.height);
          if (4 === e) return E.RGBAFormat;
          if (3 === e) return E.RGBFormat;
          if (1 === e) return E.AlphaFormat;
          throw Error("images with only 2 channels are not supported");
        }
        prerenderTexture(t) {
          (t.needsUpdate = !0),
            this.renderer.initTexture(t),
            (t.image = new ImageData(1, 1));
        }
      }
      let K = null;
      function Q(t) {
        return function () {
          return (function (t) {
            return K || (K = new ImageLoader(t, V.createJpegDecodeWorker)), K;
          })(t);
        };
      }
      var $ = i(9262),
        q = i(20477),
        J = i.n(q);
      (0, $.h)(function () {
        return J()(
          '(()=>{"use strict";var t={396:function(){!function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(t="utf-8"){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextEncoder\': The encoding label provided (\'${t}\') is invalid.`)}function i(t="utf-8",e={fatal:!1}){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextDecoder\': The encoding label provided (\'${t}\') is invalid.`);if(e.fatal)throw new Error("Failed to construct \'TextDecoder\': the \'fatal\' option is unsupported.")}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to encode: the \'stream\' option is unsupported.");let i=0;const a=t.length;let n=0,r=Math.max(32,a+(a>>1)+7),s=new Uint8Array(r>>3<<3);for(;i<a;){let e=t.charCodeAt(i++);if(e>=55296&&e<=56319){if(i<a){const a=t.charCodeAt(i);56320==(64512&a)&&(++i,e=((1023&e)<<10)+(1023&a)+65536)}if(e>=55296&&e<=56319)continue}if(n+4>s.length){r+=8,r*=1+i/t.length*2,r=r>>3<<3;const e=new Uint8Array(r);e.set(s),s=e}if(0!=(4294967168&e)){if(0==(4294965248&e))s[n++]=e>>6&31|192;else if(0==(4294901760&e))s[n++]=e>>12&15|224,s[n++]=e>>6&63|128;else{if(0!=(4292870144&e))continue;s[n++]=e>>18&7|240,s[n++]=e>>12&63|128,s[n++]=e>>6&63|128}s[n++]=63&e|128}else s[n++]=e}return s.slice(0,n)},Object.defineProperty(i.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(i.prototype,"fatal",{value:!1}),Object.defineProperty(i.prototype,"ignoreBOM",{value:!1}),i.prototype.decode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to decode: the \'stream\' option is unsupported.");const i=new Uint8Array(t);let a=0;const n=i.length,r=[];for(;a<n;){const t=i[a++];if(0===t)break;if(0==(128&t))r.push(t);else if(192==(224&t)){const e=63&i[a++];r.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&i[a++],n=63&i[a++];r.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&i[a++])<<12|(63&i[a++])<<6|63&i[a++];e>65535&&(e-=65536,r.push(e>>>10&1023|55296),e=56320|1023&e),r.push(e)}}return String.fromCharCode.apply(null,r)},t.TextEncoder=e,t.TextDecoder=i}("undefined"!=typeof window?window:"undefined"!=typeof self?self:this)}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var r=e[a]={exports:{}};return t[a].call(r.exports,r,r.exports,i),r.exports}(()=>{i(396);const t=new TextDecoder("utf-8");const e=new TextEncoder;class IOBuffer_IOBuffer{constructor(t=8192,e={}){let i=!1;"number"==typeof t?t=new ArrayBuffer(t):(i=!0,this.lastWrittenByte=t.byteLength);const a=e.offset?e.offset>>>0:0,n=t.byteLength-a;let r=a;(ArrayBuffer.isView(t)||t instanceof IOBuffer_IOBuffer)&&(t.byteLength!==t.buffer.byteLength&&(r=t.byteOffset+a),t=t.buffer),this.lastWrittenByte=i?n:0,this.buffer=t,this.length=n,this.byteLength=n,this.byteOffset=r,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,r,n),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),i=new Uint8Array(e);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){const e=new Uint8Array(t);for(let i=0;i<t;i++)e[i]=this.readByte();return e}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let i=0;i<t;i++)e+=this.readChar();return e}readUtf8(e=1){return i=this.readBytes(e),t.decode(i);var i}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(function(t){return e.encode(t)}(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function a(t){let e=t.length;for(;--e>=0;)t[e]=0}const n=256,r=286,s=30,o=15,h=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),f=new Array(576);a(f);const c=new Array(60);a(c);const u=new Array(512);a(u);const w=new Array(256);a(w);const g=new Array(29);a(g);const b=new Array(s);function p(t,e,i,a,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=a,this.max_length=n,this.has_stree=t&&t.length}let m,k,y;function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(b);const E=t=>t<256?u[t]:u[256+(t>>>7)],A=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,i)=>{t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,A(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)},U=(t,e,i)=>{x(t,i[2*e],i[2*e+1])},z=(t,e)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1},R=(t,e,i)=>{const a=new Array(16);let n,r,s=0;for(n=1;n<=o;n++)a[n]=s=s+i[n-1]<<1;for(r=0;r<=e;r++){let e=t[2*r+1];0!==e&&(t[2*r]=z(a[e]++,e))}},O=t=>{let e;for(e=0;e<r;e++)t.dyn_ltree[2*e]=0;for(e=0;e<s;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},N=t=>{t.bi_valid>8?A(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},B=(t,e,i,a)=>{const n=2*e,r=2*i;return t[n]<t[r]||t[n]===t[r]&&a[e]<=a[i]},L=(t,e,i)=>{const a=t.heap[i];let n=i<<1;for(;n<=t.heap_len&&(n<t.heap_len&&B(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!B(e,a,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=a},T=(t,e,i)=>{let a,r,s,o,d=0;if(0!==t.last_lit)do{a=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],r=t.pending_buf[t.l_buf+d],d++,0===a?U(t,r,e):(s=w[r],U(t,s+n+1,e),o=h[s],0!==o&&(r-=g[s],x(t,r,o)),a--,s=E(a),U(t,s,i),o=l[s],0!==o&&(a-=b[s],x(t,a,o)))}while(d<t.last_lit);U(t,256,e)},D=(t,e)=>{const i=e.dyn_tree,a=e.stat_desc.static_tree,n=e.stat_desc.has_stree,r=e.stat_desc.elems;let s,h,l,d=-1;for(t.heap_len=0,t.heap_max=573,s=0;s<r;s++)0!==i[2*s]?(t.heap[++t.heap_len]=d=s,t.depth[s]=0):i[2*s+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=d<2?++d:0,i[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=a[2*l+1]);for(e.max_code=d,s=t.heap_len>>1;s>=1;s--)L(t,i,s);l=r;do{s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],L(t,i,1),h=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=h,i[2*l]=i[2*s]+i[2*h],t.depth[l]=(t.depth[s]>=t.depth[h]?t.depth[s]:t.depth[h])+1,i[2*s+1]=i[2*h+1]=l,t.heap[1]=l++,L(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const i=e.dyn_tree,a=e.max_code,n=e.stat_desc.static_tree,r=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,l=e.stat_desc.max_length;let d,_,f,c,u,w,g=0;for(c=0;c<=o;c++)t.bl_count[c]=0;for(i[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)_=t.heap[d],c=i[2*i[2*_+1]+1]+1,c>l&&(c=l,g++),i[2*_+1]=c,_>a||(t.bl_count[c]++,u=0,_>=h&&(u=s[_-h]),w=i[2*_],t.opt_len+=w*(c+u),r&&(t.static_len+=w*(n[2*_+1]+u)));if(0!==g){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(c=l;0!==c;c--)for(_=t.bl_count[c];0!==_;)f=t.heap[--d],f>a||(i[2*f+1]!==c&&(t.opt_len+=(c-i[2*f+1])*i[2*f],i[2*f+1]=c),_--)}})(t,e),R(i,d,t.bl_count)},I=(t,e,i)=>{let a,n,r=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(i+1)+1]=65535,a=0;a<=i;a++)n=s,s=e[2*(a+1)+1],++o<h&&n===s||(o<l?t.bl_tree[2*n]+=o:0!==n?(n!==r&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,r=n,0===s?(h=138,l=3):n===s?(h=6,l=3):(h=7,l=4))},Z=(t,e,i)=>{let a,n,r=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),a=0;a<=i;a++)if(n=s,s=e[2*(a+1)+1],!(++o<h&&n===s)){if(o<l)do{U(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==r&&(U(t,n,t.bl_tree),o--),U(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(U(t,17,t.bl_tree),x(t,o-3,3)):(U(t,18,t.bl_tree),x(t,o-11,7));o=0,r=n,0===s?(h=138,l=3):n===s?(h=6,l=3):(h=7,l=4)}};let S=!1;const C=(t,e,i,a)=>{x(t,0+(a?1:0),3),((t,e,i,a)=>{N(t),a&&(A(t,i),A(t,~i)),t.pending_buf.set(t.window.subarray(e,e+i),t.pending),t.pending+=i})(t,e,i,!0)};var F={_tr_init:t=>{S||((()=>{let t,e,i,a,n;const _=new Array(16);for(i=0,a=0;a<28;a++)for(g[a]=i,t=0;t<1<<h[a];t++)w[i++]=a;for(w[i-1]=a,n=0,a=0;a<16;a++)for(b[a]=n,t=0;t<1<<l[a];t++)u[n++]=a;for(n>>=7;a<s;a++)for(b[a]=n<<7,t=0;t<1<<l[a]-7;t++)u[256+n++]=a;for(e=0;e<=o;e++)_[e]=0;for(t=0;t<=143;)f[2*t+1]=8,t++,_[8]++;for(;t<=255;)f[2*t+1]=9,t++,_[9]++;for(;t<=279;)f[2*t+1]=7,t++,_[7]++;for(;t<=287;)f[2*t+1]=8,t++,_[8]++;for(R(f,287,_),t=0;t<s;t++)c[2*t+1]=5,c[2*t]=z(t,5);m=new p(f,h,257,r,o),k=new p(c,l,0,s,o),y=new p(new Array(0),d,0,19,7)})(),S=!0),t.l_desc=new v(t.dyn_ltree,m),t.d_desc=new v(t.dyn_dtree,k),t.bl_desc=new v(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,O(t)},_tr_stored_block:C,_tr_flush_block:(t,e,i,a)=>{let r,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<n;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),D(t,t.l_desc),D(t,t.d_desc),o=(t=>{let e;for(I(t,t.dyn_ltree,t.l_desc.max_code),I(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),r=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==e?C(t,e,i,a):4===t.strategy||s===r?(x(t,2+(a?1:0),3),T(t,f,c)):(x(t,4+(a?1:0),3),((t,e,i,a)=>{let n;for(x(t,e-257,5),x(t,i-1,5),x(t,a-4,4),n=0;n<a;n++)x(t,t.bl_tree[2*_[n]+1],3);Z(t,t.dyn_ltree,e-1),Z(t,t.dyn_dtree,i-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),T(t,t.dyn_ltree,t.dyn_dtree)),O(t),a&&N(t)},_tr_tally:(t,e,i)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(w[i]+n+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),U(t,256,f),(t=>{16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var M=(t,e,i,a)=>{let n=65535&t|0,r=t>>>16&65535|0,s=0;for(;0!==i;){s=i>2e3?2e3:i,i-=s;do{n=n+e[a++]|0,r=r+n|0}while(--s);n%=65521,r%=65521}return n|r<<16|0};const H=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var a=0;a<8;a++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var W=(t,e,i,a)=>{const n=H,r=a+i;t^=-1;for(let i=a;i<r;i++)t=t>>>8^n[255&(t^e[i])];return-1^t},K={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},P={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:j,_tr_stored_block:Y,_tr_flush_block:G,_tr_tally:$,_tr_align:V}=F,{Z_NO_FLUSH:X,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:tt,Z_OK:et,Z_STREAM_END:it,Z_STREAM_ERROR:at,Z_DATA_ERROR:nt,Z_BUF_ERROR:rt,Z_DEFAULT_COMPRESSION:st,Z_FILTERED:ot,Z_HUFFMAN_ONLY:ht,Z_RLE:lt,Z_FIXED:dt,Z_DEFAULT_STRATEGY:_t,Z_UNKNOWN:ft,Z_DEFLATED:ct}=P,ut=258,wt=262,gt=103,bt=113,pt=666,mt=(t,e)=>(t.msg=K[e],e),kt=t=>(t<<1)-(t>4?9:0),yt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let vt=(t,e,i)=>(e<<t.hash_shift^i)&t.hash_mask;const Et=t=>{const e=t.state;let i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+i),t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))},At=(t,e)=>{G(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},Ut=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},zt=(t,e,i,a)=>{let n=t.avail_in;return n>a&&(n=a),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),i),1===t.state.wrap?t.adler=M(t.adler,e,n,i):2===t.state.wrap&&(t.adler=W(t.adler,e,n,i)),t.next_in+=n,t.total_in+=n,n)},Rt=(t,e)=>{let i,a,n=t.max_chain_length,r=t.strstart,s=t.prev_length,o=t.nice_match;const h=t.strstart>t.w_size-wt?t.strstart-(t.w_size-wt):0,l=t.window,d=t.w_mask,_=t.prev,f=t.strstart+ut;let c=l[r+s-1],u=l[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(i=e,l[i+s]===u&&l[i+s-1]===c&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do{}while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=ut-(f-r),r=f-ut,a>s){if(t.match_start=e,s=a,a>=o)break;c=l[r+s-1],u=l[r+s]}}}while((e=_[e&d])>h&&0!=--n);return s<=t.lookahead?s:t.lookahead},Ot=t=>{const e=t.w_size;let i,a,n,r,s;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-wt)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,a=t.hash_size,i=a;do{n=t.head[--i],t.head[i]=n>=e?n-e:0}while(--a);a=e,i=a;do{n=t.prev[--i],t.prev[i]=n>=e?n-e:0}while(--a);r+=e}if(0===t.strm.avail_in)break;if(a=zt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=vt(t,t.ins_h,t.window[s+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[s+3-1]),t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<wt&&0!==t.strm.avail_in)},Nt=(t,e)=>{let i,a;for(;;){if(t.lookahead<wt){if(Ot(t),t.lookahead<wt&&e===X)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-wt&&(t.match_length=Rt(t,i)),t.match_length>=3)if(a=$(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else a=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(a&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2},Bt=(t,e)=>{let i,a,n;for(;;){if(t.lookahead<wt){if(Ot(t),t.lookahead<wt&&e===X)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-wt&&(t.match_length=Rt(t,i),t.match_length<=5&&(t.strategy===ot||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,a=$(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,a&&(At(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(a=$(t,0,t.window[t.strstart-1]),a&&At(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(a=$(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2};function Lt(t,e,i,a,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=a,this.func=n}const Tt=[new Lt(0,0,0,0,((t,e)=>{let i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ot(t),0===t.lookahead&&e===X)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const a=t.block_start+i;if((0===t.strstart||t.strstart>=a)&&(t.lookahead=t.strstart-a,t.strstart=a,At(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-wt&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(At(t,!1),t.strm.avail_out),1)})),new Lt(4,4,8,4,Nt),new Lt(4,5,16,8,Nt),new Lt(4,6,32,32,Nt),new Lt(4,4,16,16,Bt),new Lt(8,16,32,32,Bt),new Lt(8,16,128,128,Bt),new Lt(8,32,128,256,Bt),new Lt(32,128,258,1024,Bt),new Lt(32,258,258,4096,Bt)];function Dt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),yt(this.dyn_ltree),yt(this.dyn_dtree),yt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),yt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const It=t=>{if(!t||!t.state)return mt(t,at);t.total_in=t.total_out=0,t.data_type=ft;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:bt,t.adler=2===e.wrap?0:1,e.last_flush=X,j(e),et},Zt=t=>{const e=It(t);var i;return e===et&&((i=t.state).window_size=2*i.w_size,yt(i.head),i.max_lazy_match=Tt[i.level].max_lazy,i.good_match=Tt[i.level].good_length,i.nice_match=Tt[i.level].nice_length,i.max_chain_length=Tt[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),e},St=(t,e,i,a,n,r)=>{if(!t)return at;let s=1;if(e===st&&(e=6),a<0?(s=0,a=-a):a>15&&(s=2,a-=16),n<1||n>9||i!==ct||a<8||a>15||e<0||e>9||r<0||r>dt)return mt(t,at);8===a&&(a=9);const o=new Dt;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=a,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=r,o.method=i,Zt(t)};var Ct={deflateInit:(t,e)=>St(t,e,ct,15,8,_t),deflateInit2:St,deflateReset:Zt,deflateResetKeep:It,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?at:(t.state.gzhead=e,et):at,deflate:(t,e)=>{let i,a;if(!t||!t.state||e>tt||e<0)return t?mt(t,at):at;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===pt&&e!==Q)return mt(t,0===t.avail_out?rt:at);n.strm=t;const r=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=ht||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=W(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=ht||n.level<2?4:0),xt(n,3),n.status=bt);else{let e=ct+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=ht||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=i<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=bt,Ut(n,e),0!==n.strstart&&(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,xt(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,xt(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(t.adler=W(t.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=gt)}else n.status=gt;if(n.status===gt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Et(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=bt)):n.status=bt),0!==n.pending){if(Et(t),0===t.avail_out)return n.last_flush=-1,et}else if(0===t.avail_in&&kt(e)<=kt(r)&&e!==Q)return mt(t,rt);if(n.status===pt&&0!==t.avail_in)return mt(t,rt);if(0!==t.avail_in||0!==n.lookahead||e!==X&&n.status!==pt){let i=n.strategy===ht?((t,e)=>{let i;for(;;){if(0===t.lookahead&&(Ot(t),0===t.lookahead)){if(e===X)return 1;break}if(t.match_length=0,i=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let i,a,n,r;const s=t.window;for(;;){if(t.lookahead<=ut){if(Ot(t),t.lookahead<=ut&&e===X)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,a=s[n],a===s[++n]&&a===s[++n]&&a===s[++n])){r=t.strstart+ut;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&n<r);t.match_length=ut-(r-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=$(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=$(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2})(n,e):Tt[n.level].func(n,e);if(3!==i&&4!==i||(n.status=pt),1===i||3===i)return 0===t.avail_out&&(n.last_flush=-1),et;if(2===i&&(e===q?V(n):e!==tt&&(Y(n,0,0,!1),e===J&&(yt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Et(t),0===t.avail_out))return n.last_flush=-1,et}return e!==Q?et:n.wrap<=0?it:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),Et(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?et:it)},deflateEnd:t=>{if(!t||!t.state)return at;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==gt&&e!==bt&&e!==pt?mt(t,at):(t.state=null,e===bt?mt(t,nt):et)},deflateSetDictionary:(t,e)=>{let i=e.length;if(!t||!t.state)return at;const a=t.state,n=a.wrap;if(2===n||1===n&&42!==a.status||a.lookahead)return at;if(1===n&&(t.adler=M(t.adler,e,i,0)),a.wrap=0,i>=a.w_size){0===n&&(yt(a.head),a.strstart=0,a.block_start=0,a.insert=0);let t=new Uint8Array(a.w_size);t.set(e.subarray(i-a.w_size,i),0),e=t,i=a.w_size}const r=t.avail_in,s=t.next_in,o=t.input;for(t.avail_in=i,t.next_in=0,t.input=e,Ot(a);a.lookahead>=3;){let t=a.strstart,e=a.lookahead-2;do{a.ins_h=vt(a,a.ins_h,a.window[t+3-1]),a.prev[t&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=t,t++}while(--e);a.strstart=t,a.lookahead=2,Ot(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=s,t.input=o,t.avail_in=r,a.wrap=n,et},deflateInfo:"pako deflate (from Nodeca project)"};const Ft=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Mt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)Ft(i,e)&&(t[e]=i[e])}}return t},Ht=t=>{let e=0;for(let i=0,a=t.length;i<a;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,a=0,n=t.length;e<n;e++){let n=t[e];i.set(n,a),a+=n.length}return i};let Wt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Wt=!1}const Kt=new Uint8Array(256);for(let t=0;t<256;t++)Kt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Kt[254]=Kt[254]=1;var Pt=t=>{let e,i,a,n,r,s=t.length,o=0;for(n=0;n<s;n++)i=t.charCodeAt(n),55296==(64512&i)&&n+1<s&&(a=t.charCodeAt(n+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),n++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(o),r=0,n=0;r<o;n++)i=t.charCodeAt(n),55296==(64512&i)&&n+1<s&&(a=t.charCodeAt(n+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),n++)),i<128?e[r++]=i:i<2048?(e[r++]=192|i>>>6,e[r++]=128|63&i):i<65536?(e[r++]=224|i>>>12,e[r++]=128|i>>>6&63,e[r++]=128|63&i):(e[r++]=240|i>>>18,e[r++]=128|i>>>12&63,e[r++]=128|i>>>6&63,e[r++]=128|63&i);return e},jt=(t,e)=>{let i,a;const n=e||t.length,r=new Array(2*n);for(a=0,i=0;i<n;){let e=t[i++];if(e<128){r[a++]=e;continue}let s=Kt[e];if(s>4)r[a++]=65533,i+=s-1;else{for(e&=2===s?31:3===s?15:7;s>1&&i<n;)e=e<<6|63&t[i++],s--;s>1?r[a++]=65533:e<65536?r[a++]=e:(e-=65536,r[a++]=55296|e>>10&1023,r[a++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Wt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i})(r,a)},Yt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Kt[t[i]]>e?i:e};var Gt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const $t=Object.prototype.toString,{Z_NO_FLUSH:Vt,Z_SYNC_FLUSH:Xt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:te,Z_DEFAULT_COMPRESSION:ee,Z_DEFAULT_STRATEGY:ie,Z_DEFLATED:ae}=P;function ne(t){this.options=Mt({level:ee,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:ie},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;let i=Ct.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==Qt)throw new Error(K[i]);if(e.header&&Ct.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Pt(e.dictionary):"[object ArrayBuffer]"===$t.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=Ct.deflateSetDictionary(this.strm,t),i!==Qt)throw new Error(K[i]);this._dict_set=!0}}function re(t,e){const i=new ne(e);if(i.push(t,!0),i.err)throw i.msg||K[i.err];return i.result}ne.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize;let n,r;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Jt:Vt,"string"==typeof t?i.input=Pt(t):"[object ArrayBuffer]"===$t.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),(r===Xt||r===qt)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(n=Ct.deflate(i,r),n===te)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=Ct.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==i.avail_out){if(r>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},ne.prototype.onData=function(t){this.chunks.push(t)},ne.prototype.onEnd=function(t){t===Qt&&(this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var se={Deflate:ne,deflate:re,deflateRaw:function(t,e){return(e=e||{}).raw=!0,re(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,re(t,e)},constants:P};var oe=function(t,e){let i,a,n,r,s,o,h,l,d,_,f,c,u,w,g,b,p,m,k,y,v,E,A,x;const U=t.state;i=t.next_in,A=t.input,a=i+(t.avail_in-5),n=t.next_out,x=t.output,r=n-(e-t.avail_out),s=n+(t.avail_out-257),o=U.dmax,h=U.wsize,l=U.whave,d=U.wnext,_=U.window,f=U.hold,c=U.bits,u=U.lencode,w=U.distcode,g=(1<<U.lenbits)-1,b=(1<<U.distbits)-1;t:do{c<15&&(f+=A[i++]<<c,c+=8,f+=A[i++]<<c,c+=8),p=u[f&g];e:for(;;){if(m=p>>>24,f>>>=m,c-=m,m=p>>>16&255,0===m)x[n++]=65535&p;else{if(!(16&m)){if(0==(64&m)){p=u[(65535&p)+(f&(1<<m)-1)];continue e}if(32&m){U.mode=12;break t}t.msg="invalid literal/length code",U.mode=30;break t}k=65535&p,m&=15,m&&(c<m&&(f+=A[i++]<<c,c+=8),k+=f&(1<<m)-1,f>>>=m,c-=m),c<15&&(f+=A[i++]<<c,c+=8,f+=A[i++]<<c,c+=8),p=w[f&b];i:for(;;){if(m=p>>>24,f>>>=m,c-=m,m=p>>>16&255,!(16&m)){if(0==(64&m)){p=w[(65535&p)+(f&(1<<m)-1)];continue i}t.msg="invalid distance code",U.mode=30;break t}if(y=65535&p,m&=15,c<m&&(f+=A[i++]<<c,c+=8,c<m&&(f+=A[i++]<<c,c+=8)),y+=f&(1<<m)-1,y>o){t.msg="invalid distance too far back",U.mode=30;break t}if(f>>>=m,c-=m,m=n-r,y>m){if(m=y-m,m>l&&U.sane){t.msg="invalid distance too far back",U.mode=30;break t}if(v=0,E=_,0===d){if(v+=h-m,m<k){k-=m;do{x[n++]=_[v++]}while(--m);v=n-y,E=x}}else if(d<m){if(v+=h+d-m,m-=d,m<k){k-=m;do{x[n++]=_[v++]}while(--m);if(v=0,d<k){m=d,k-=m;do{x[n++]=_[v++]}while(--m);v=n-y,E=x}}}else if(v+=d-m,m<k){k-=m;do{x[n++]=_[v++]}while(--m);v=n-y,E=x}for(;k>2;)x[n++]=E[v++],x[n++]=E[v++],x[n++]=E[v++],k-=3;k&&(x[n++]=E[v++],k>1&&(x[n++]=E[v++]))}else{v=n-y;do{x[n++]=x[v++],x[n++]=x[v++],x[n++]=x[v++],k-=3}while(k>2);k&&(x[n++]=x[v++],k>1&&(x[n++]=x[v++]))}break}}break}}while(i<a&&n<s);k=c>>3,i-=k,c-=k<<3,f&=(1<<c)-1,t.next_in=i,t.next_out=n,t.avail_in=i<a?a-i+5:5-(i-a),t.avail_out=n<s?s-n+257:257-(n-s),U.hold=f,U.bits=c};const he=15,le=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),de=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),_e=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),fe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ce=(t,e,i,a,n,r,s,o)=>{const h=o.bits;let l,d,_,f,c,u,w=0,g=0,b=0,p=0,m=0,k=0,y=0,v=0,E=0,A=0,x=null,U=0;const z=new Uint16Array(16),R=new Uint16Array(16);let O,N,B,L=null,T=0;for(w=0;w<=he;w++)z[w]=0;for(g=0;g<a;g++)z[e[i+g]]++;for(m=h,p=he;p>=1&&0===z[p];p--);if(m>p&&(m=p),0===p)return n[r++]=20971520,n[r++]=20971520,o.bits=1,0;for(b=1;b<p&&0===z[b];b++);for(m<b&&(m=b),v=1,w=1;w<=he;w++)if(v<<=1,v-=z[w],v<0)return-1;if(v>0&&(0===t||1!==p))return-1;for(R[1]=0,w=1;w<he;w++)R[w+1]=R[w]+z[w];for(g=0;g<a;g++)0!==e[i+g]&&(s[R[e[i+g]]++]=g);if(0===t?(x=L=s,u=19):1===t?(x=le,U-=257,L=de,T-=257,u=256):(x=_e,L=fe,u=-1),A=0,g=0,w=b,c=r,k=m,y=0,_=-1,E=1<<m,f=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){O=w-y,s[g]<u?(N=0,B=s[g]):s[g]>u?(N=L[T+s[g]],B=x[U+s[g]]):(N=96,B=0),l=1<<w-y,d=1<<k,b=d;do{d-=l,n[c+(A>>y)+d]=O<<24|N<<16|B|0}while(0!==d);for(l=1<<w-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,g++,0==--z[w]){if(w===p)break;w=e[i+s[g]]}if(w>m&&(A&f)!==_){for(0===y&&(y=m),c+=b,k=w-y,v=1<<k;k+y<p&&(v-=z[k+y],!(v<=0));)k++,v<<=1;if(E+=1<<k,1===t&&E>852||2===t&&E>592)return 1;_=A&f,n[_]=m<<24|k<<16|c-r|0}}return 0!==A&&(n[c+A]=w-y<<24|64<<16|0),o.bits=m,0};const{Z_FINISH:ue,Z_BLOCK:we,Z_TREES:ge,Z_OK:be,Z_STREAM_END:pe,Z_NEED_DICT:me,Z_STREAM_ERROR:ke,Z_DATA_ERROR:ye,Z_MEM_ERROR:ve,Z_BUF_ERROR:Ee,Z_DEFLATED:Ae}=P,xe=12,Ue=30,ze=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Re(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Oe=t=>{if(!t||!t.state)return ke;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,be},Ne=t=>{if(!t||!t.state)return ke;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Oe(t)},Be=(t,e)=>{let i;if(!t||!t.state)return ke;const a=t.state;return e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ke:(null!==a.window&&a.wbits!==e&&(a.window=null),a.wrap=i,a.wbits=e,Ne(t))},Le=(t,e)=>{if(!t)return ke;const i=new Re;t.state=i,i.window=null;const a=Be(t,e);return a!==be&&(t.state=null),a};let Te,De,Ie=!0;const Ze=t=>{if(Ie){Te=new Int32Array(512),De=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ce(1,t.lens,0,288,Te,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ce(2,t.lens,0,32,De,0,t.work,{bits:5}),Ie=!1}t.lencode=Te,t.lenbits=9,t.distcode=De,t.distbits=5},Se=(t,e,i,a)=>{let n;const r=t.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),a>=r.wsize?(r.window.set(e.subarray(i-r.wsize,i),0),r.wnext=0,r.whave=r.wsize):(n=r.wsize-r.wnext,n>a&&(n=a),r.window.set(e.subarray(i-a,i-a+n),r.wnext),(a-=n)?(r.window.set(e.subarray(i-a,i),0),r.wnext=a,r.whave=r.wsize):(r.wnext+=n,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=n))),0};var Ce={inflateReset:Ne,inflateReset2:Be,inflateResetKeep:Oe,inflateInit:t=>Le(t,15),inflateInit2:Le,inflate:(t,e)=>{let i,a,n,r,s,o,h,l,d,_,f,c,u,w,g,b,p,m,k,y,v,E,A=0;const x=new Uint8Array(4);let U,z;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return ke;i=t.state,i.mode===xe&&(i.mode=13),s=t.next_out,n=t.output,h=t.avail_out,r=t.next_in,a=t.input,o=t.avail_in,l=i.hold,d=i.bits,_=o,f=h,E=be;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;d<16;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(2&i.wrap&&35615===l){i.check=0,x[0]=255&l,x[1]=l>>>8&255,i.check=W(i.check,x,2,0),l=0,d=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",i.mode=Ue;break}if((15&l)!==Ae){t.msg="unknown compression method",i.mode=Ue;break}if(l>>>=4,d-=4,v=8+(15&l),0===i.wbits)i.wbits=v;else if(v>i.wbits){t.msg="invalid window size",i.mode=Ue;break}i.dmax=1<<i.wbits,t.adler=i.check=1,i.mode=512&l?10:xe,l=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(i.flags=l,(255&i.flags)!==Ae){t.msg="unknown compression method",i.mode=Ue;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=Ue;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=W(i.check,x,2,0)),l=0,d=0,i.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.head&&(i.head.time=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,i.check=W(i.check,x,4,0)),l=0,d=0,i.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=W(i.check,x,2,0)),l=0,d=0,i.mode=5;case 5:if(1024&i.flags){for(;d<16;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=W(i.check,x,2,0)),l=0,d=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(c=i.length,c>o&&(c=o),c&&(i.head&&(v=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(a.subarray(r,r+c),v)),512&i.flags&&(i.check=W(i.check,a,c,r)),o-=c,r+=c,i.length-=c),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===o)break t;c=0;do{v=a[r+c++],i.head&&v&&i.length<65536&&(i.head.name+=String.fromCharCode(v))}while(v&&c<o);if(512&i.flags&&(i.check=W(i.check,a,c,r)),o-=c,r+=c,v)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===o)break t;c=0;do{v=a[r+c++],i.head&&v&&i.length<65536&&(i.head.comment+=String.fromCharCode(v))}while(v&&c<o);if(512&i.flags&&(i.check=W(i.check,a,c,r)),o-=c,r+=c,v)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;d<16;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(l!==(65535&i.check)){t.msg="header crc mismatch",i.mode=Ue;break}l=0,d=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=xe;break;case 10:for(;d<32;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}t.adler=i.check=ze(l),l=0,d=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=s,t.avail_out=h,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=d,me;t.adler=i.check=1,i.mode=xe;case xe:if(e===we||e===ge)break t;case 13:if(i.last){l>>>=7&d,d-=7&d,i.mode=27;break}for(;d<3;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}switch(i.last=1&l,l>>>=1,d-=1,3&l){case 0:i.mode=14;break;case 1:if(Ze(i),i.mode=20,e===ge){l>>>=2,d-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=Ue}l>>>=2,d-=2;break;case 14:for(l>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",i.mode=Ue;break}if(i.length=65535&l,l=0,d=0,i.mode=15,e===ge)break t;case 15:i.mode=16;case 16:if(c=i.length,c){if(c>o&&(c=o),c>h&&(c=h),0===c)break t;n.set(a.subarray(r,r+c),s),o-=c,r+=c,h-=c,s+=c,i.length-=c;break}i.mode=xe;break;case 17:for(;d<14;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(i.nlen=257+(31&l),l>>>=5,d-=5,i.ndist=1+(31&l),l>>>=5,d-=5,i.ncode=4+(15&l),l>>>=4,d-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=Ue;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;d<3;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.lens[R[i.have++]]=7&l,l>>>=3,d-=3}for(;i.have<19;)i.lens[R[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,U={bits:i.lenbits},E=ce(0,i.lens,0,19,i.lencode,0,i.work,U),i.lenbits=U.bits,E){t.msg="invalid code lengths set",i.mode=Ue;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;A=i.lencode[l&(1<<i.lenbits)-1],g=A>>>24,b=A>>>16&255,p=65535&A,!(g<=d);){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(p<16)l>>>=g,d-=g,i.lens[i.have++]=p;else{if(16===p){for(z=g+2;d<z;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(l>>>=g,d-=g,0===i.have){t.msg="invalid bit length repeat",i.mode=Ue;break}v=i.lens[i.have-1],c=3+(3&l),l>>>=2,d-=2}else if(17===p){for(z=g+3;d<z;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}l>>>=g,d-=g,v=0,c=3+(7&l),l>>>=3,d-=3}else{for(z=g+7;d<z;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}l>>>=g,d-=g,v=0,c=11+(127&l),l>>>=7,d-=7}if(i.have+c>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=Ue;break}for(;c--;)i.lens[i.have++]=v}}if(i.mode===Ue)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=Ue;break}if(i.lenbits=9,U={bits:i.lenbits},E=ce(1,i.lens,0,i.nlen,i.lencode,0,i.work,U),i.lenbits=U.bits,E){t.msg="invalid literal/lengths set",i.mode=Ue;break}if(i.distbits=6,i.distcode=i.distdyn,U={bits:i.distbits},E=ce(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,U),i.distbits=U.bits,E){t.msg="invalid distances set",i.mode=Ue;break}if(i.mode=20,e===ge)break t;case 20:i.mode=21;case 21:if(o>=6&&h>=258){t.next_out=s,t.avail_out=h,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=d,oe(t,f),s=t.next_out,n=t.output,h=t.avail_out,r=t.next_in,a=t.input,o=t.avail_in,l=i.hold,d=i.bits,i.mode===xe&&(i.back=-1);break}for(i.back=0;A=i.lencode[l&(1<<i.lenbits)-1],g=A>>>24,b=A>>>16&255,p=65535&A,!(g<=d);){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(b&&0==(240&b)){for(m=g,k=b,y=p;A=i.lencode[y+((l&(1<<m+k)-1)>>m)],g=A>>>24,b=A>>>16&255,p=65535&A,!(m+g<=d);){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}l>>>=m,d-=m,i.back+=m}if(l>>>=g,d-=g,i.back+=g,i.length=p,0===b){i.mode=26;break}if(32&b){i.back=-1,i.mode=xe;break}if(64&b){t.msg="invalid literal/length code",i.mode=Ue;break}i.extra=15&b,i.mode=22;case 22:if(i.extra){for(z=i.extra;d<z;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,d-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;A=i.distcode[l&(1<<i.distbits)-1],g=A>>>24,b=A>>>16&255,p=65535&A,!(g<=d);){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(0==(240&b)){for(m=g,k=b,y=p;A=i.distcode[y+((l&(1<<m+k)-1)>>m)],g=A>>>24,b=A>>>16&255,p=65535&A,!(m+g<=d);){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}l>>>=m,d-=m,i.back+=m}if(l>>>=g,d-=g,i.back+=g,64&b){t.msg="invalid distance code",i.mode=Ue;break}i.offset=p,i.extra=15&b,i.mode=24;case 24:if(i.extra){for(z=i.extra;d<z;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,d-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=Ue;break}i.mode=25;case 25:if(0===h)break t;if(c=f-h,i.offset>c){if(c=i.offset-c,c>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=Ue;break}c>i.wnext?(c-=i.wnext,u=i.wsize-c):u=i.wnext-c,c>i.length&&(c=i.length),w=i.window}else w=n,u=s-i.offset,c=i.length;c>h&&(c=h),h-=c,i.length-=c;do{n[s++]=w[u++]}while(--c);0===i.length&&(i.mode=21);break;case 26:if(0===h)break t;n[s++]=i.length,h--,i.mode=21;break;case 27:if(i.wrap){for(;d<32;){if(0===o)break t;o--,l|=a[r++]<<d,d+=8}if(f-=h,t.total_out+=f,i.total+=f,f&&(t.adler=i.check=i.flags?W(i.check,n,f,s-f):M(i.check,n,f,s-f)),f=h,(i.flags?l:ze(l))!==i.check){t.msg="incorrect data check",i.mode=Ue;break}l=0,d=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;d<32;){if(0===o)break t;o--,l+=a[r++]<<d,d+=8}if(l!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=Ue;break}l=0,d=0}i.mode=29;case 29:E=pe;break t;case Ue:E=ye;break t;case 31:return ve;case 32:default:return ke}return t.next_out=s,t.avail_out=h,t.next_in=r,t.avail_in=o,i.hold=l,i.bits=d,(i.wsize||f!==t.avail_out&&i.mode<Ue&&(i.mode<27||e!==ue))&&Se(t,t.output,t.next_out,f-t.avail_out),_-=t.avail_in,f-=t.avail_out,t.total_in+=_,t.total_out+=f,i.total+=f,i.wrap&&f&&(t.adler=i.check=i.flags?W(i.check,n,f,t.next_out-f):M(i.check,n,f,t.next_out-f)),t.data_type=i.bits+(i.last?64:0)+(i.mode===xe?128:0)+(20===i.mode||15===i.mode?256:0),(0===_&&0===f||e===ue)&&E===be&&(E=Ee),E},inflateEnd:t=>{if(!t||!t.state)return ke;let e=t.state;return e.window&&(e.window=null),t.state=null,be},inflateGetHeader:(t,e)=>{if(!t||!t.state)return ke;const i=t.state;return 0==(2&i.wrap)?ke:(i.head=e,e.done=!1,be)},inflateSetDictionary:(t,e)=>{const i=e.length;let a,n,r;return t&&t.state?(a=t.state,0!==a.wrap&&11!==a.mode?ke:11===a.mode&&(n=1,n=M(n,e,i,0),n!==a.check)?ye:(r=Se(t,e,i,i),r?(a.mode=31,ve):(a.havedict=1,be))):ke},inflateInfo:"pako inflate (from Nodeca project)"};var Fe=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Me=Object.prototype.toString,{Z_NO_FLUSH:He,Z_FINISH:We,Z_OK:Ke,Z_STREAM_END:Pe,Z_NEED_DICT:je,Z_STREAM_ERROR:Ye,Z_DATA_ERROR:Ge,Z_MEM_ERROR:$e}=P;function Ve(t){this.options=Mt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Gt,this.strm.avail_out=0;let i=Ce.inflateInit2(this.strm,e.windowBits);if(i!==Ke)throw new Error(K[i]);if(this.header=new Fe,Ce.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Pt(e.dictionary):"[object ArrayBuffer]"===Me.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Ce.inflateSetDictionary(this.strm,e.dictionary),i!==Ke)))throw new Error(K[i])}function Xe(t,e){const i=new Ve(e);if(i.push(t),i.err)throw i.msg||K[i.err];return i.result}Ve.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize,n=this.options.dictionary;let r,s,o;if(this.ended)return!1;for(s=e===~~e?e:!0===e?We:He,"[object ArrayBuffer]"===Me.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),r=Ce.inflate(i,s),r===je&&n&&(r=Ce.inflateSetDictionary(i,n),r===Ke?r=Ce.inflate(i,s):r===Ge&&(r=je));i.avail_in>0&&r===Pe&&i.state.wrap>0&&0!==t[i.next_in];)Ce.inflateReset(i),r=Ce.inflate(i,s);switch(r){case Ye:case Ge:case je:case $e:return this.onEnd(r),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||r===Pe))if("string"===this.options.to){let t=Yt(i.output,i.next_out),e=i.next_out-t,n=jt(i.output,t);i.next_out=e,i.avail_out=a-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(n)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(r!==Ke||0!==o){if(r===Pe)return r=Ce.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},Ve.prototype.onData=function(t){this.chunks.push(t)},Ve.prototype.onEnd=function(t){t===Ke&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Ve,inflate:Xe,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Xe(t,e)},ungzip:Xe,constants:P};const{Deflate:Je,deflate:Qe,deflateRaw:ti,gzip:ei}=se,{Inflate:ii,inflate:ai,inflateRaw:ni,ungzip:ri}=qe;var si=Qe;const oi=[137,80,78,71,13,10,26,10],hi=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;hi[t]=e}const li=4294967295;function di(t,e){return(function(t,e,i){let a=t;for(let t=0;t<i;t++)a=hi[255&(a^e[t])]^a>>>8;return a}(li,t,e)^li)>>>0}var _i,fi,ci,ui;!function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.GREYSCALE=0]="GREYSCALE",t[t.TRUECOLOUR=2]="TRUECOLOUR",t[t.INDEXED_COLOUR=3]="INDEXED_COLOUR",t[t.GREYSCALE_ALPHA=4]="GREYSCALE_ALPHA",t[t.TRUECOLOUR_ALPHA=6]="TRUECOLOUR_ALPHA"}(_i||(_i={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.DEFLATE=0]="DEFLATE"}(fi||(fi={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.ADAPTIVE=0]="ADAPTIVE"}(ci||(ci={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.NO_INTERLACE=0]="NO_INTERLACE",t[t.ADAM7=1]="ADAM7"}(ui||(ui={}));new Uint8Array(0);const wi=new Uint16Array([255]);new Uint8Array(wi.buffer)[0];const gi={level:3};class PNGEncoder extends IOBuffer_IOBuffer{constructor(t,e={}){super(),this._colorType=_i.UNKNOWN,this._zlibOptions=Object.assign({},gi,e.zlib),this._png=this._checkData(t),this.setBigEndian()}encode(){return this.encodeSignature(),this.encodeIHDR(),this.encodeData(),this.encodeIEND(),this.toArray()}encodeSignature(){this.writeBytes(oi)}encodeIHDR(){this.writeUint32(13),this.writeChars("IHDR"),this.writeUint32(this._png.width),this.writeUint32(this._png.height),this.writeByte(this._png.depth),this.writeByte(this._colorType),this.writeByte(fi.DEFLATE),this.writeByte(ci.ADAPTIVE),this.writeByte(ui.NO_INTERLACE),this.writeCrc(17)}encodeIEND(){this.writeUint32(0),this.writeChars("IEND"),this.writeCrc(4)}encodeIDAT(t){this.writeUint32(t.length),this.writeChars("IDAT"),this.writeBytes(t),this.writeCrc(t.length+4)}encodeData(){const{width:t,height:e,channels:i,depth:a,data:n}=this._png,r=i*t,s=(new IOBuffer_IOBuffer).setBigEndian();let o=0;for(let t=0;t<e;t++)if(s.writeByte(0),8===a)o=pi(n,s,r,o);else{if(16!==a)throw new Error("unreachable");o=mi(n,s,r,o)}const h=s.toArray(),l=si(h,this._zlibOptions);this.encodeIDAT(l)}_checkData(t){const{colorType:e,channels:i,depth:a}=function(t){const{channels:e=4,depth:i=8}=t;if(4!==e&&3!==e&&2!==e&&1!==e)throw new RangeError(`unsupported number of channels: ${e}`);if(8!==i&&16!==i)throw new RangeError(`unsupported bit depth: ${i}`);const a={channels:e,depth:i,colorType:_i.UNKNOWN};switch(e){case 4:a.colorType=_i.TRUECOLOUR_ALPHA;break;case 3:a.colorType=_i.TRUECOLOUR;break;case 1:a.colorType=_i.GREYSCALE;break;case 2:a.colorType=_i.GREYSCALE_ALPHA;break;default:throw new Error("unsupported number of channels")}return a}(t),n={width:bi(t.width,"width"),height:bi(t.height,"height"),channels:i,data:t.data,depth:a,text:{}};this._colorType=e;const r=n.width*n.height*i;if(n.data.length!==r)throw new RangeError(`wrong data size. Found ${n.data.length}, expected ${r}`);return n}writeCrc(t){this.writeUint32(di(new Uint8Array(this.buffer,this.byteOffset+this.offset-t,t),t))}}function bi(t,e){if(Number.isInteger(t)&&t>0)return t;throw new TypeError(`${e} must be a positive integer`)}function pi(t,e,i,a){for(let n=0;n<i;n++)e.writeByte(t[a++]);return a}function mi(t,e,i,a){for(let n=0;n<i;n++)e.writeUint16(t[a++]);return a}var ki;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(ki||(ki={})),self.addEventListener("message",(t=>{const{data:e,width:i,height:a,options:n}=t.data,r=function(t,e){return new PNGEncoder(t,e).encode()}({data:new Uint8Array(e),width:i,height:a},n);postMessage({data:r,width:i,height:a},[r])}))})()})();',
          "Worker",
          void 0,
          void 0
        );
      });
      const tt = (0, $.h)(function () {
        return J()(
          '(()=>{"use strict";var t={396:function(){!function(t){if(t.TextEncoder&&t.TextDecoder)return!1;function e(t="utf-8"){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextEncoder\': The encoding label provided (\'${t}\') is invalid.`)}function i(t="utf-8",e={fatal:!1}){if("utf-8"!==t)throw new RangeError(`Failed to construct \'TextDecoder\': The encoding label provided (\'${t}\') is invalid.`);if(e.fatal)throw new Error("Failed to construct \'TextDecoder\': the \'fatal\' option is unsupported.")}Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to encode: the \'stream\' option is unsupported.");let i=0;const a=t.length;let n=0,s=Math.max(32,a+(a>>1)+7),r=new Uint8Array(s>>3<<3);for(;i<a;){let e=t.charCodeAt(i++);if(e>=55296&&e<=56319){if(i<a){const a=t.charCodeAt(i);56320==(64512&a)&&(++i,e=((1023&e)<<10)+(1023&a)+65536)}if(e>=55296&&e<=56319)continue}if(n+4>r.length){s+=8,s*=1+i/t.length*2,s=s>>3<<3;const e=new Uint8Array(s);e.set(r),r=e}if(0!=(4294967168&e)){if(0==(4294965248&e))r[n++]=e>>6&31|192;else if(0==(4294901760&e))r[n++]=e>>12&15|224,r[n++]=e>>6&63|128;else{if(0!=(4292870144&e))continue;r[n++]=e>>18&7|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128}r[n++]=63&e|128}else r[n++]=e}return r.slice(0,n)},Object.defineProperty(i.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(i.prototype,"fatal",{value:!1}),Object.defineProperty(i.prototype,"ignoreBOM",{value:!1}),i.prototype.decode=function(t,e={stream:!1}){if(e.stream)throw new Error("Failed to decode: the \'stream\' option is unsupported.");const i=new Uint8Array(t);let a=0;const n=i.length,s=[];for(;a<n;){const t=i[a++];if(0===t)break;if(0==(128&t))s.push(t);else if(192==(224&t)){const e=63&i[a++];s.push((31&t)<<6|e)}else if(224==(240&t)){const e=63&i[a++],n=63&i[a++];s.push((31&t)<<12|e<<6|n)}else if(240==(248&t)){let e=(7&t)<<18|(63&i[a++])<<12|(63&i[a++])<<6|63&i[a++];e>65535&&(e-=65536,s.push(e>>>10&1023|55296),e=56320|1023&e),s.push(e)}}return String.fromCharCode.apply(null,s)},t.TextEncoder=e,t.TextDecoder=i}("undefined"!=typeof window?window:"undefined"!=typeof self?self:this)}},e={};function i(a){var n=e[a];if(void 0!==n)return n.exports;var s=e[a]={exports:{}};return t[a].call(s.exports,s,s.exports,i),s.exports}(()=>{i(396);const t=new TextDecoder("utf-8");const e=new TextEncoder;class IOBuffer_IOBuffer{constructor(t=8192,e={}){let i=!1;"number"==typeof t?t=new ArrayBuffer(t):(i=!0,this.lastWrittenByte=t.byteLength);const a=e.offset?e.offset>>>0:0,n=t.byteLength-a;let s=a;(ArrayBuffer.isView(t)||t instanceof IOBuffer_IOBuffer)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+a),t=t.buffer),this.lastWrittenByte=i?n:0,this.buffer=t,this.length=n,this.byteLength=n,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,n),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(void 0===t)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const e=2*(this.offset+t),i=new Uint8Array(e);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=this.byteLength=e,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){const e=new Uint8Array(t);for(let i=0;i<t;i++)e[i]=this.readByte();return e}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let i=0;i<t;i++)e+=this.readChar();return e}readUtf8(e=1){return i=this.readBytes(e),t.decode(i);var i}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(function(t){return e.encode(t)}(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function a(t){let e=t.length;for(;--e>=0;)t[e]=0}const n=256,s=286,r=30,o=15,h=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),l=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),f=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_=new Array(576);a(_);const c=new Array(60);a(c);const u=new Array(512);a(u);const w=new Array(256);a(w);const p=new Array(29);a(p);const g=new Array(r);function b(t,e,i,a,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=a,this.max_length=n,this.has_stree=t&&t.length}let m,k,y;function v(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(g);const E=t=>t<256?u[t]:u[256+(t>>>7)],A=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},x=(t,e,i)=>{t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,A(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)},U=(t,e,i)=>{x(t,i[2*e],i[2*e+1])},z=(t,e)=>{let i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1},R=(t,e,i)=>{const a=new Array(16);let n,s,r=0;for(n=1;n<=o;n++)a[n]=r=r+i[n-1]<<1;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=z(a[e]++,e))}},N=t=>{let e;for(e=0;e<s;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},O=t=>{t.bi_valid>8?A(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},L=(t,e,i,a)=>{const n=2*e,s=2*i;return t[n]<t[s]||t[n]===t[s]&&a[e]<=a[i]},T=(t,e,i)=>{const a=t.heap[i];let n=i<<1;for(;n<=t.heap_len&&(n<t.heap_len&&L(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!L(e,a,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=a},D=(t,e,i)=>{let a,s,r,o,d=0;if(0!==t.last_lit)do{a=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===a?U(t,s,e):(r=w[s],U(t,r+n+1,e),o=h[r],0!==o&&(s-=p[r],x(t,s,o)),a--,r=E(a),U(t,r,i),o=l[r],0!==o&&(a-=g[r],x(t,a,o)))}while(d<t.last_lit);U(t,256,e)},I=(t,e)=>{const i=e.dyn_tree,a=e.stat_desc.static_tree,n=e.stat_desc.has_stree,s=e.stat_desc.elems;let r,h,l,d=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<s;r++)0!==i[2*r]?(t.heap[++t.heap_len]=d=r,t.depth[r]=0):i[2*r+1]=0;for(;t.heap_len<2;)l=t.heap[++t.heap_len]=d<2?++d:0,i[2*l]=1,t.depth[l]=0,t.opt_len--,n&&(t.static_len-=a[2*l+1]);for(e.max_code=d,r=t.heap_len>>1;r>=1;r--)T(t,i,r);l=s;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],T(t,i,1),h=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=h,i[2*l]=i[2*r]+i[2*h],t.depth[l]=(t.depth[r]>=t.depth[h]?t.depth[r]:t.depth[h])+1,i[2*r+1]=i[2*h+1]=l,t.heap[1]=l++,T(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const i=e.dyn_tree,a=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,r=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,l=e.stat_desc.max_length;let d,f,_,c,u,w,p=0;for(c=0;c<=o;c++)t.bl_count[c]=0;for(i[2*t.heap[t.heap_max]+1]=0,d=t.heap_max+1;d<573;d++)f=t.heap[d],c=i[2*i[2*f+1]+1]+1,c>l&&(c=l,p++),i[2*f+1]=c,f>a||(t.bl_count[c]++,u=0,f>=h&&(u=r[f-h]),w=i[2*f],t.opt_len+=w*(c+u),s&&(t.static_len+=w*(n[2*f+1]+u)));if(0!==p){do{for(c=l-1;0===t.bl_count[c];)c--;t.bl_count[c]--,t.bl_count[c+1]+=2,t.bl_count[l]--,p-=2}while(p>0);for(c=l;0!==c;c--)for(f=t.bl_count[c];0!==f;)_=t.heap[--d],_>a||(i[2*_+1]!==c&&(t.opt_len+=(c-i[2*_+1])*i[2*_],i[2*_+1]=c),f--)}})(t,e),R(i,d,t.bl_count)},S=(t,e,i)=>{let a,n,s=-1,r=e[1],o=0,h=7,l=4;for(0===r&&(h=138,l=3),e[2*(i+1)+1]=65535,a=0;a<=i;a++)n=r,r=e[2*(a+1)+1],++o<h&&n===r||(o<l?t.bl_tree[2*n]+=o:0!==n?(n!==s&&t.bl_tree[2*n]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,s=n,0===r?(h=138,l=3):n===r?(h=6,l=3):(h=7,l=4))},B=(t,e,i)=>{let a,n,s=-1,r=e[1],o=0,h=7,l=4;for(0===r&&(h=138,l=3),a=0;a<=i;a++)if(n=r,r=e[2*(a+1)+1],!(++o<h&&n===r)){if(o<l)do{U(t,n,t.bl_tree)}while(0!=--o);else 0!==n?(n!==s&&(U(t,n,t.bl_tree),o--),U(t,16,t.bl_tree),x(t,o-3,2)):o<=10?(U(t,17,t.bl_tree),x(t,o-3,3)):(U(t,18,t.bl_tree),x(t,o-11,7));o=0,s=n,0===r?(h=138,l=3):n===r?(h=6,l=3):(h=7,l=4)}};let Z=!1;const C=(t,e,i,a)=>{x(t,0+(a?1:0),3),((t,e,i,a)=>{O(t),a&&(A(t,i),A(t,~i)),t.pending_buf.set(t.window.subarray(e,e+i),t.pending),t.pending+=i})(t,e,i,!0)};var F={_tr_init:t=>{Z||((()=>{let t,e,i,a,n;const f=new Array(16);for(i=0,a=0;a<28;a++)for(p[a]=i,t=0;t<1<<h[a];t++)w[i++]=a;for(w[i-1]=a,n=0,a=0;a<16;a++)for(g[a]=n,t=0;t<1<<l[a];t++)u[n++]=a;for(n>>=7;a<r;a++)for(g[a]=n<<7,t=0;t<1<<l[a]-7;t++)u[256+n++]=a;for(e=0;e<=o;e++)f[e]=0;for(t=0;t<=143;)_[2*t+1]=8,t++,f[8]++;for(;t<=255;)_[2*t+1]=9,t++,f[9]++;for(;t<=279;)_[2*t+1]=7,t++,f[7]++;for(;t<=287;)_[2*t+1]=8,t++,f[8]++;for(R(_,287,f),t=0;t<r;t++)c[2*t+1]=5,c[2*t]=z(t,5);m=new b(_,h,257,s,o),k=new b(c,l,0,r,o),y=new b(new Array(0),d,0,19,7)})(),Z=!0),t.l_desc=new v(t.dyn_ltree,m),t.d_desc=new v(t.dyn_dtree,k),t.bl_desc=new v(t.bl_tree,y),t.bi_buf=0,t.bi_valid=0,N(t)},_tr_stored_block:C,_tr_flush_block:(t,e,i,a)=>{let s,r,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<n;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),I(t,t.l_desc),I(t,t.d_desc),o=(t=>{let e;for(S(t,t.dyn_ltree,t.l_desc.max_code),S(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*f[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),s=t.opt_len+3+7>>>3,r=t.static_len+3+7>>>3,r<=s&&(s=r)):s=r=i+5,i+4<=s&&-1!==e?C(t,e,i,a):4===t.strategy||r===s?(x(t,2+(a?1:0),3),D(t,_,c)):(x(t,4+(a?1:0),3),((t,e,i,a)=>{let n;for(x(t,e-257,5),x(t,i-1,5),x(t,a-4,4),n=0;n<a;n++)x(t,t.bl_tree[2*f[n]+1],3);B(t,t.dyn_ltree,e-1),B(t,t.dyn_dtree,i-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),D(t,t.dyn_ltree,t.dyn_dtree)),N(t),a&&O(t)},_tr_tally:(t,e,i)=>(t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(w[i]+n+1)]++,t.dyn_dtree[2*E(e)]++),t.last_lit===t.lit_bufsize-1),_tr_align:t=>{x(t,2,3),U(t,256,_),(t=>{16===t.bi_valid?(A(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var M=(t,e,i,a)=>{let n=65535&t|0,s=t>>>16&65535|0,r=0;for(;0!==i;){r=i>2e3?2e3:i,i-=r;do{n=n+e[a++]|0,s=s+n|0}while(--r);n%=65521,s%=65521}return n|s<<16|0};const H=new Uint32Array((()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var a=0;a<8;a++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e})());var P=(t,e,i,a)=>{const n=H,s=a+i;t^=-1;for(let i=a;i<s;i++)t=t>>>8^n[255&(t^e[i])];return-1^t},W={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},K={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$,_tr_stored_block:Y,_tr_flush_block:j,_tr_tally:G,_tr_align:X}=F,{Z_NO_FLUSH:V,Z_PARTIAL_FLUSH:q,Z_FULL_FLUSH:J,Z_FINISH:Q,Z_BLOCK:tt,Z_OK:et,Z_STREAM_END:it,Z_STREAM_ERROR:at,Z_DATA_ERROR:nt,Z_BUF_ERROR:st,Z_DEFAULT_COMPRESSION:rt,Z_FILTERED:ot,Z_HUFFMAN_ONLY:ht,Z_RLE:lt,Z_FIXED:dt,Z_DEFAULT_STRATEGY:ft,Z_UNKNOWN:_t,Z_DEFLATED:ct}=K,ut=258,wt=262,pt=103,gt=113,bt=666,mt=(t,e)=>(t.msg=W[e],e),kt=t=>(t<<1)-(t>4?9:0),yt=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let vt=(t,e,i)=>(e<<t.hash_shift^i)&t.hash_mask;const Et=t=>{const e=t.state;let i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+i),t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))},At=(t,e)=>{j(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Et(t.strm)},xt=(t,e)=>{t.pending_buf[t.pending++]=e},Ut=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},zt=(t,e,i,a)=>{let n=t.avail_in;return n>a&&(n=a),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),i),1===t.state.wrap?t.adler=M(t.adler,e,n,i):2===t.state.wrap&&(t.adler=P(t.adler,e,n,i)),t.next_in+=n,t.total_in+=n,n)},Rt=(t,e)=>{let i,a,n=t.max_chain_length,s=t.strstart,r=t.prev_length,o=t.nice_match;const h=t.strstart>t.w_size-wt?t.strstart-(t.w_size-wt):0,l=t.window,d=t.w_mask,f=t.prev,_=t.strstart+ut;let c=l[s+r-1],u=l[s+r];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do{if(i=e,l[i+r]===u&&l[i+r-1]===c&&l[i]===l[s]&&l[++i]===l[s+1]){s+=2,i++;do{}while(l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&s<_);if(a=ut-(_-s),s=_-ut,a>r){if(t.match_start=e,r=a,a>=o)break;c=l[s+r-1],u=l[s+r]}}}while((e=f[e&d])>h&&0!=--n);return r<=t.lookahead?r:t.lookahead},Nt=t=>{const e=t.w_size;let i,a,n,s,r;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-wt)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,a=t.hash_size,i=a;do{n=t.head[--i],t.head[i]=n>=e?n-e:0}while(--a);a=e,i=a;do{n=t.prev[--i],t.prev[i]=n>=e?n-e:0}while(--a);s+=e}if(0===t.strm.avail_in)break;if(a=zt(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=a,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=vt(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=vt(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<wt&&0!==t.strm.avail_in)},Ot=(t,e)=>{let i,a;for(;;){if(t.lookahead<wt){if(Nt(t),t.lookahead<wt&&e===V)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-wt&&(t.match_length=Rt(t,i)),t.match_length>=3)if(a=G(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=vt(t,t.ins_h,t.window[t.strstart+1]);else a=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(a&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2},Lt=(t,e)=>{let i,a,n;for(;;){if(t.lookahead<wt){if(Nt(t),t.lookahead<wt&&e===V)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-wt&&(t.match_length=Rt(t,i),t.match_length<=5&&(t.strategy===ot||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,a=G(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=vt(t,t.ins_h,t.window[t.strstart+3-1]),i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,a&&(At(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(a=G(t,0,t.window[t.strstart-1]),a&&At(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(a=G(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2};function Tt(t,e,i,a,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=a,this.func=n}const Dt=[new Tt(0,0,0,0,((t,e)=>{let i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Nt(t),0===t.lookahead&&e===V)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const a=t.block_start+i;if((0===t.strstart||t.strstart>=a)&&(t.lookahead=t.strstart-a,t.strstart=a,At(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-wt&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(At(t,!1),t.strm.avail_out),1)})),new Tt(4,4,8,4,Ot),new Tt(4,5,16,8,Ot),new Tt(4,6,32,32,Ot),new Tt(4,4,16,16,Lt),new Tt(8,16,32,32,Lt),new Tt(8,16,128,128,Lt),new Tt(8,32,128,256,Lt),new Tt(32,128,258,1024,Lt),new Tt(32,258,258,4096,Lt)];function It(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),yt(this.dyn_ltree),yt(this.dyn_dtree),yt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),yt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),yt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const St=t=>{if(!t||!t.state)return mt(t,at);t.total_in=t.total_out=0,t.data_type=_t;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:gt,t.adler=2===e.wrap?0:1,e.last_flush=V,$(e),et},Bt=t=>{const e=St(t);var i;return e===et&&((i=t.state).window_size=2*i.w_size,yt(i.head),i.max_lazy_match=Dt[i.level].max_lazy,i.good_match=Dt[i.level].good_length,i.nice_match=Dt[i.level].nice_length,i.max_chain_length=Dt[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),e},Zt=(t,e,i,a,n,s)=>{if(!t)return at;let r=1;if(e===rt&&(e=6),a<0?(r=0,a=-a):a>15&&(r=2,a-=16),n<1||n>9||i!==ct||a<8||a>15||e<0||e>9||s<0||s>dt)return mt(t,at);8===a&&(a=9);const o=new It;return t.state=o,o.strm=t,o.wrap=r,o.gzhead=null,o.w_bits=a,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=e,o.strategy=s,o.method=i,Bt(t)};var Ct={deflateInit:(t,e)=>Zt(t,e,ct,15,8,ft),deflateInit2:Zt,deflateReset:Bt,deflateResetKeep:St,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?at:(t.state.gzhead=e,et):at,deflate:(t,e)=>{let i,a;if(!t||!t.state||e>tt||e<0)return t?mt(t,at):at;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||n.status===bt&&e!==Q)return mt(t,0===t.avail_out?st:at);n.strm=t;const s=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,xt(n,31),xt(n,139),xt(n,8),n.gzhead?(xt(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),xt(n,255&n.gzhead.time),xt(n,n.gzhead.time>>8&255),xt(n,n.gzhead.time>>16&255),xt(n,n.gzhead.time>>24&255),xt(n,9===n.level?2:n.strategy>=ht||n.level<2?4:0),xt(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(xt(n,255&n.gzhead.extra.length),xt(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=P(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,0),xt(n,9===n.level?2:n.strategy>=ht||n.level<2?4:0),xt(n,3),n.status=gt);else{let e=ct+(n.w_bits-8<<4)<<8,i=-1;i=n.strategy>=ht||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=i<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=gt,Ut(n,e),0!==n.strstart&&(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending!==n.pending_buf_size));)xt(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,xt(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),Et(t),i=n.pending,n.pending===n.pending_buf_size)){a=1;break}a=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,xt(n,a)}while(0!==a);n.gzhead.hcrc&&n.pending>i&&(t.adler=P(t.adler,n.pending_buf,n.pending-i,i)),0===a&&(n.status=pt)}else n.status=pt;if(n.status===pt&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Et(t),n.pending+2<=n.pending_buf_size&&(xt(n,255&t.adler),xt(n,t.adler>>8&255),t.adler=0,n.status=gt)):n.status=gt),0!==n.pending){if(Et(t),0===t.avail_out)return n.last_flush=-1,et}else if(0===t.avail_in&&kt(e)<=kt(s)&&e!==Q)return mt(t,st);if(n.status===bt&&0!==t.avail_in)return mt(t,st);if(0!==t.avail_in||0!==n.lookahead||e!==V&&n.status!==bt){let i=n.strategy===ht?((t,e)=>{let i;for(;;){if(0===t.lookahead&&(Nt(t),0===t.lookahead)){if(e===V)return 1;break}if(t.match_length=0,i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===lt?((t,e)=>{let i,a,n,s;const r=t.window;for(;;){if(t.lookahead<=ut){if(Nt(t),t.lookahead<=ut&&e===V)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=t.strstart-1,a=r[n],a===r[++n]&&a===r[++n]&&a===r[++n])){s=t.strstart+ut;do{}while(a===r[++n]&&a===r[++n]&&a===r[++n]&&a===r[++n]&&a===r[++n]&&a===r[++n]&&a===r[++n]&&a===r[++n]&&n<s);t.match_length=ut-(s-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=G(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=G(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(At(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===Q?(At(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(At(t,!1),0===t.strm.avail_out)?1:2})(n,e):Dt[n.level].func(n,e);if(3!==i&&4!==i||(n.status=bt),1===i||3===i)return 0===t.avail_out&&(n.last_flush=-1),et;if(2===i&&(e===q?X(n):e!==tt&&(Y(n,0,0,!1),e===J&&(yt(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Et(t),0===t.avail_out))return n.last_flush=-1,et}return e!==Q?et:n.wrap<=0?it:(2===n.wrap?(xt(n,255&t.adler),xt(n,t.adler>>8&255),xt(n,t.adler>>16&255),xt(n,t.adler>>24&255),xt(n,255&t.total_in),xt(n,t.total_in>>8&255),xt(n,t.total_in>>16&255),xt(n,t.total_in>>24&255)):(Ut(n,t.adler>>>16),Ut(n,65535&t.adler)),Et(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?et:it)},deflateEnd:t=>{if(!t||!t.state)return at;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==pt&&e!==gt&&e!==bt?mt(t,at):(t.state=null,e===gt?mt(t,nt):et)},deflateSetDictionary:(t,e)=>{let i=e.length;if(!t||!t.state)return at;const a=t.state,n=a.wrap;if(2===n||1===n&&42!==a.status||a.lookahead)return at;if(1===n&&(t.adler=M(t.adler,e,i,0)),a.wrap=0,i>=a.w_size){0===n&&(yt(a.head),a.strstart=0,a.block_start=0,a.insert=0);let t=new Uint8Array(a.w_size);t.set(e.subarray(i-a.w_size,i),0),e=t,i=a.w_size}const s=t.avail_in,r=t.next_in,o=t.input;for(t.avail_in=i,t.next_in=0,t.input=e,Nt(a);a.lookahead>=3;){let t=a.strstart,e=a.lookahead-2;do{a.ins_h=vt(a,a.ins_h,a.window[t+3-1]),a.prev[t&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=t,t++}while(--e);a.strstart=t,a.lookahead=2,Nt(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,t.next_in=r,t.input=o,t.avail_in=s,a.wrap=n,et},deflateInfo:"pako deflate (from Nodeca project)"};const Ft=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Mt=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)Ft(i,e)&&(t[e]=i[e])}}return t},Ht=t=>{let e=0;for(let i=0,a=t.length;i<a;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,a=0,n=t.length;e<n;e++){let n=t[e];i.set(n,a),a+=n.length}return i};let Pt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Pt=!1}const Wt=new Uint8Array(256);for(let t=0;t<256;t++)Wt[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Wt[254]=Wt[254]=1;var Kt=t=>{let e,i,a,n,s,r=t.length,o=0;for(n=0;n<r;n++)i=t.charCodeAt(n),55296==(64512&i)&&n+1<r&&(a=t.charCodeAt(n+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),n++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(o),s=0,n=0;s<o;n++)i=t.charCodeAt(n),55296==(64512&i)&&n+1<r&&(a=t.charCodeAt(n+1),56320==(64512&a)&&(i=65536+(i-55296<<10)+(a-56320),n++)),i<128?e[s++]=i:i<2048?(e[s++]=192|i>>>6,e[s++]=128|63&i):i<65536?(e[s++]=224|i>>>12,e[s++]=128|i>>>6&63,e[s++]=128|63&i):(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63,e[s++]=128|i>>>6&63,e[s++]=128|63&i);return e},$t=(t,e)=>{let i,a;const n=e||t.length,s=new Array(2*n);for(a=0,i=0;i<n;){let e=t[i++];if(e<128){s[a++]=e;continue}let r=Wt[e];if(r>4)s[a++]=65533,i+=r-1;else{for(e&=2===r?31:3===r?15:7;r>1&&i<n;)e=e<<6|63&t[i++],r--;r>1?s[a++]=65533:e<65536?s[a++]=e:(e-=65536,s[a++]=55296|e>>10&1023,s[a++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Pt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let a=0;a<e;a++)i+=String.fromCharCode(t[a]);return i})(s,a)},Yt=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+Wt[t[i]]>e?i:e};var jt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Gt=Object.prototype.toString,{Z_NO_FLUSH:Xt,Z_SYNC_FLUSH:Vt,Z_FULL_FLUSH:qt,Z_FINISH:Jt,Z_OK:Qt,Z_STREAM_END:te,Z_DEFAULT_COMPRESSION:ee,Z_DEFAULT_STRATEGY:ie,Z_DEFLATED:ae}=K;function ne(t){this.options=Mt({level:ee,method:ae,chunkSize:16384,windowBits:15,memLevel:8,strategy:ie},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;let i=Ct.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(i!==Qt)throw new Error(W[i]);if(e.header&&Ct.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Kt(e.dictionary):"[object ArrayBuffer]"===Gt.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,i=Ct.deflateSetDictionary(this.strm,t),i!==Qt)throw new Error(W[i]);this._dict_set=!0}}function se(t,e){const i=new ne(e);if(i.push(t,!0),i.err)throw i.msg||W[i.err];return i.result}ne.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize;let n,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?Jt:Xt,"string"==typeof t?i.input=Kt(t):"[object ArrayBuffer]"===Gt.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),(s===Vt||s===qt)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(n=Ct.deflate(i,s),n===te)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),n=Ct.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Qt;if(0!==i.avail_out){if(s>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},ne.prototype.onData=function(t){this.chunks.push(t)},ne.prototype.onEnd=function(t){t===Qt&&(this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var re={Deflate:ne,deflate:se,deflateRaw:function(t,e){return(e=e||{}).raw=!0,se(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,se(t,e)},constants:K};var oe=function(t,e){let i,a,n,s,r,o,h,l,d,f,_,c,u,w,p,g,b,m,k,y,v,E,A,x;const U=t.state;i=t.next_in,A=t.input,a=i+(t.avail_in-5),n=t.next_out,x=t.output,s=n-(e-t.avail_out),r=n+(t.avail_out-257),o=U.dmax,h=U.wsize,l=U.whave,d=U.wnext,f=U.window,_=U.hold,c=U.bits,u=U.lencode,w=U.distcode,p=(1<<U.lenbits)-1,g=(1<<U.distbits)-1;t:do{c<15&&(_+=A[i++]<<c,c+=8,_+=A[i++]<<c,c+=8),b=u[_&p];e:for(;;){if(m=b>>>24,_>>>=m,c-=m,m=b>>>16&255,0===m)x[n++]=65535&b;else{if(!(16&m)){if(0==(64&m)){b=u[(65535&b)+(_&(1<<m)-1)];continue e}if(32&m){U.mode=12;break t}t.msg="invalid literal/length code",U.mode=30;break t}k=65535&b,m&=15,m&&(c<m&&(_+=A[i++]<<c,c+=8),k+=_&(1<<m)-1,_>>>=m,c-=m),c<15&&(_+=A[i++]<<c,c+=8,_+=A[i++]<<c,c+=8),b=w[_&g];i:for(;;){if(m=b>>>24,_>>>=m,c-=m,m=b>>>16&255,!(16&m)){if(0==(64&m)){b=w[(65535&b)+(_&(1<<m)-1)];continue i}t.msg="invalid distance code",U.mode=30;break t}if(y=65535&b,m&=15,c<m&&(_+=A[i++]<<c,c+=8,c<m&&(_+=A[i++]<<c,c+=8)),y+=_&(1<<m)-1,y>o){t.msg="invalid distance too far back",U.mode=30;break t}if(_>>>=m,c-=m,m=n-s,y>m){if(m=y-m,m>l&&U.sane){t.msg="invalid distance too far back",U.mode=30;break t}if(v=0,E=f,0===d){if(v+=h-m,m<k){k-=m;do{x[n++]=f[v++]}while(--m);v=n-y,E=x}}else if(d<m){if(v+=h+d-m,m-=d,m<k){k-=m;do{x[n++]=f[v++]}while(--m);if(v=0,d<k){m=d,k-=m;do{x[n++]=f[v++]}while(--m);v=n-y,E=x}}}else if(v+=d-m,m<k){k-=m;do{x[n++]=f[v++]}while(--m);v=n-y,E=x}for(;k>2;)x[n++]=E[v++],x[n++]=E[v++],x[n++]=E[v++],k-=3;k&&(x[n++]=E[v++],k>1&&(x[n++]=E[v++]))}else{v=n-y;do{x[n++]=x[v++],x[n++]=x[v++],x[n++]=x[v++],k-=3}while(k>2);k&&(x[n++]=x[v++],k>1&&(x[n++]=x[v++]))}break}}break}}while(i<a&&n<r);k=c>>3,i-=k,c-=k<<3,_&=(1<<c)-1,t.next_in=i,t.next_out=n,t.avail_in=i<a?a-i+5:5-(i-a),t.avail_out=n<r?r-n+257:257-(n-r),U.hold=_,U.bits=c};const he=15,le=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),de=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),fe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_e=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ce=(t,e,i,a,n,s,r,o)=>{const h=o.bits;let l,d,f,_,c,u,w=0,p=0,g=0,b=0,m=0,k=0,y=0,v=0,E=0,A=0,x=null,U=0;const z=new Uint16Array(16),R=new Uint16Array(16);let N,O,L,T=null,D=0;for(w=0;w<=he;w++)z[w]=0;for(p=0;p<a;p++)z[e[i+p]]++;for(m=h,b=he;b>=1&&0===z[b];b--);if(m>b&&(m=b),0===b)return n[s++]=20971520,n[s++]=20971520,o.bits=1,0;for(g=1;g<b&&0===z[g];g++);for(m<g&&(m=g),v=1,w=1;w<=he;w++)if(v<<=1,v-=z[w],v<0)return-1;if(v>0&&(0===t||1!==b))return-1;for(R[1]=0,w=1;w<he;w++)R[w+1]=R[w]+z[w];for(p=0;p<a;p++)0!==e[i+p]&&(r[R[e[i+p]]++]=p);if(0===t?(x=T=r,u=19):1===t?(x=le,U-=257,T=de,D-=257,u=256):(x=fe,T=_e,u=-1),A=0,p=0,w=g,c=s,k=m,y=0,f=-1,E=1<<m,_=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){N=w-y,r[p]<u?(O=0,L=r[p]):r[p]>u?(O=T[D+r[p]],L=x[U+r[p]]):(O=96,L=0),l=1<<w-y,d=1<<k,g=d;do{d-=l,n[c+(A>>y)+d]=N<<24|O<<16|L|0}while(0!==d);for(l=1<<w-1;A&l;)l>>=1;if(0!==l?(A&=l-1,A+=l):A=0,p++,0==--z[w]){if(w===b)break;w=e[i+r[p]]}if(w>m&&(A&_)!==f){for(0===y&&(y=m),c+=g,k=w-y,v=1<<k;k+y<b&&(v-=z[k+y],!(v<=0));)k++,v<<=1;if(E+=1<<k,1===t&&E>852||2===t&&E>592)return 1;f=A&_,n[f]=m<<24|k<<16|c-s|0}}return 0!==A&&(n[c+A]=w-y<<24|64<<16|0),o.bits=m,0};const{Z_FINISH:ue,Z_BLOCK:we,Z_TREES:pe,Z_OK:ge,Z_STREAM_END:be,Z_NEED_DICT:me,Z_STREAM_ERROR:ke,Z_DATA_ERROR:ye,Z_MEM_ERROR:ve,Z_BUF_ERROR:Ee,Z_DEFLATED:Ae}=K,xe=12,Ue=30,ze=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function Re(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ne=t=>{if(!t||!t.state)return ke;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,ge},Oe=t=>{if(!t||!t.state)return ke;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Ne(t)},Le=(t,e)=>{let i;if(!t||!t.state)return ke;const a=t.state;return e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?ke:(null!==a.window&&a.wbits!==e&&(a.window=null),a.wrap=i,a.wbits=e,Oe(t))},Te=(t,e)=>{if(!t)return ke;const i=new Re;t.state=i,i.window=null;const a=Le(t,e);return a!==ge&&(t.state=null),a};let De,Ie,Se=!0;const Be=t=>{if(Se){De=new Int32Array(512),Ie=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ce(1,t.lens,0,288,De,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ce(2,t.lens,0,32,Ie,0,t.work,{bits:5}),Se=!1}t.lencode=De,t.lenbits=9,t.distcode=Ie,t.distbits=5},Ze=(t,e,i,a)=>{let n;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),a>=s.wsize?(s.window.set(e.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>a&&(n=a),s.window.set(e.subarray(i-a,i-a+n),s.wnext),(a-=n)?(s.window.set(e.subarray(i-a,i),0),s.wnext=a,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=n))),0};var Ce={inflateReset:Oe,inflateReset2:Le,inflateResetKeep:Ne,inflateInit:t=>Te(t,15),inflateInit2:Te,inflate:(t,e)=>{let i,a,n,s,r,o,h,l,d,f,_,c,u,w,p,g,b,m,k,y,v,E,A=0;const x=new Uint8Array(4);let U,z;const R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return ke;i=t.state,i.mode===xe&&(i.mode=13),r=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,a=t.input,o=t.avail_in,l=i.hold,d=i.bits,f=o,_=h,E=ge;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;d<16;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(2&i.wrap&&35615===l){i.check=0,x[0]=255&l,x[1]=l>>>8&255,i.check=P(i.check,x,2,0),l=0,d=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){t.msg="incorrect header check",i.mode=Ue;break}if((15&l)!==Ae){t.msg="unknown compression method",i.mode=Ue;break}if(l>>>=4,d-=4,v=8+(15&l),0===i.wbits)i.wbits=v;else if(v>i.wbits){t.msg="invalid window size",i.mode=Ue;break}i.dmax=1<<i.wbits,t.adler=i.check=1,i.mode=512&l?10:xe,l=0,d=0;break;case 2:for(;d<16;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(i.flags=l,(255&i.flags)!==Ae){t.msg="unknown compression method",i.mode=Ue;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=Ue;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=P(i.check,x,2,0)),l=0,d=0,i.mode=3;case 3:for(;d<32;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.head&&(i.head.time=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,i.check=P(i.check,x,4,0)),l=0,d=0,i.mode=4;case 4:for(;d<16;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=P(i.check,x,2,0)),l=0,d=0,i.mode=5;case 5:if(1024&i.flags){for(;d<16;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=P(i.check,x,2,0)),l=0,d=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(c=i.length,c>o&&(c=o),c&&(i.head&&(v=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(a.subarray(s,s+c),v)),512&i.flags&&(i.check=P(i.check,a,c,s)),o-=c,s+=c,i.length-=c),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===o)break t;c=0;do{v=a[s+c++],i.head&&v&&i.length<65536&&(i.head.name+=String.fromCharCode(v))}while(v&&c<o);if(512&i.flags&&(i.check=P(i.check,a,c,s)),o-=c,s+=c,v)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===o)break t;c=0;do{v=a[s+c++],i.head&&v&&i.length<65536&&(i.head.comment+=String.fromCharCode(v))}while(v&&c<o);if(512&i.flags&&(i.check=P(i.check,a,c,s)),o-=c,s+=c,v)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;d<16;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(l!==(65535&i.check)){t.msg="header crc mismatch",i.mode=Ue;break}l=0,d=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=xe;break;case 10:for(;d<32;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}t.adler=i.check=ze(l),l=0,d=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=r,t.avail_out=h,t.next_in=s,t.avail_in=o,i.hold=l,i.bits=d,me;t.adler=i.check=1,i.mode=xe;case xe:if(e===we||e===pe)break t;case 13:if(i.last){l>>>=7&d,d-=7&d,i.mode=27;break}for(;d<3;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}switch(i.last=1&l,l>>>=1,d-=1,3&l){case 0:i.mode=14;break;case 1:if(Be(i),i.mode=20,e===pe){l>>>=2,d-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=Ue}l>>>=2,d-=2;break;case 14:for(l>>>=7&d,d-=7&d;d<32;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if((65535&l)!=(l>>>16^65535)){t.msg="invalid stored block lengths",i.mode=Ue;break}if(i.length=65535&l,l=0,d=0,i.mode=15,e===pe)break t;case 15:i.mode=16;case 16:if(c=i.length,c){if(c>o&&(c=o),c>h&&(c=h),0===c)break t;n.set(a.subarray(s,s+c),r),o-=c,s+=c,h-=c,r+=c,i.length-=c;break}i.mode=xe;break;case 17:for(;d<14;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(i.nlen=257+(31&l),l>>>=5,d-=5,i.ndist=1+(31&l),l>>>=5,d-=5,i.ncode=4+(15&l),l>>>=4,d-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=Ue;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;d<3;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.lens[R[i.have++]]=7&l,l>>>=3,d-=3}for(;i.have<19;)i.lens[R[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,U={bits:i.lenbits},E=ce(0,i.lens,0,19,i.lencode,0,i.work,U),i.lenbits=U.bits,E){t.msg="invalid code lengths set",i.mode=Ue;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;A=i.lencode[l&(1<<i.lenbits)-1],p=A>>>24,g=A>>>16&255,b=65535&A,!(p<=d);){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(b<16)l>>>=p,d-=p,i.lens[i.have++]=b;else{if(16===b){for(z=p+2;d<z;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(l>>>=p,d-=p,0===i.have){t.msg="invalid bit length repeat",i.mode=Ue;break}v=i.lens[i.have-1],c=3+(3&l),l>>>=2,d-=2}else if(17===b){for(z=p+3;d<z;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}l>>>=p,d-=p,v=0,c=3+(7&l),l>>>=3,d-=3}else{for(z=p+7;d<z;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}l>>>=p,d-=p,v=0,c=11+(127&l),l>>>=7,d-=7}if(i.have+c>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=Ue;break}for(;c--;)i.lens[i.have++]=v}}if(i.mode===Ue)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=Ue;break}if(i.lenbits=9,U={bits:i.lenbits},E=ce(1,i.lens,0,i.nlen,i.lencode,0,i.work,U),i.lenbits=U.bits,E){t.msg="invalid literal/lengths set",i.mode=Ue;break}if(i.distbits=6,i.distcode=i.distdyn,U={bits:i.distbits},E=ce(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,U),i.distbits=U.bits,E){t.msg="invalid distances set",i.mode=Ue;break}if(i.mode=20,e===pe)break t;case 20:i.mode=21;case 21:if(o>=6&&h>=258){t.next_out=r,t.avail_out=h,t.next_in=s,t.avail_in=o,i.hold=l,i.bits=d,oe(t,_),r=t.next_out,n=t.output,h=t.avail_out,s=t.next_in,a=t.input,o=t.avail_in,l=i.hold,d=i.bits,i.mode===xe&&(i.back=-1);break}for(i.back=0;A=i.lencode[l&(1<<i.lenbits)-1],p=A>>>24,g=A>>>16&255,b=65535&A,!(p<=d);){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(g&&0==(240&g)){for(m=p,k=g,y=b;A=i.lencode[y+((l&(1<<m+k)-1)>>m)],p=A>>>24,g=A>>>16&255,b=65535&A,!(m+p<=d);){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}l>>>=m,d-=m,i.back+=m}if(l>>>=p,d-=p,i.back+=p,i.length=b,0===g){i.mode=26;break}if(32&g){i.back=-1,i.mode=xe;break}if(64&g){t.msg="invalid literal/length code",i.mode=Ue;break}i.extra=15&g,i.mode=22;case 22:if(i.extra){for(z=i.extra;d<z;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,d-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;A=i.distcode[l&(1<<i.distbits)-1],p=A>>>24,g=A>>>16&255,b=65535&A,!(p<=d);){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(0==(240&g)){for(m=p,k=g,y=b;A=i.distcode[y+((l&(1<<m+k)-1)>>m)],p=A>>>24,g=A>>>16&255,b=65535&A,!(m+p<=d);){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}l>>>=m,d-=m,i.back+=m}if(l>>>=p,d-=p,i.back+=p,64&g){t.msg="invalid distance code",i.mode=Ue;break}i.offset=b,i.extra=15&g,i.mode=24;case 24:if(i.extra){for(z=i.extra;d<z;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,d-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=Ue;break}i.mode=25;case 25:if(0===h)break t;if(c=_-h,i.offset>c){if(c=i.offset-c,c>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=Ue;break}c>i.wnext?(c-=i.wnext,u=i.wsize-c):u=i.wnext-c,c>i.length&&(c=i.length),w=i.window}else w=n,u=r-i.offset,c=i.length;c>h&&(c=h),h-=c,i.length-=c;do{n[r++]=w[u++]}while(--c);0===i.length&&(i.mode=21);break;case 26:if(0===h)break t;n[r++]=i.length,h--,i.mode=21;break;case 27:if(i.wrap){for(;d<32;){if(0===o)break t;o--,l|=a[s++]<<d,d+=8}if(_-=h,t.total_out+=_,i.total+=_,_&&(t.adler=i.check=i.flags?P(i.check,n,_,r-_):M(i.check,n,_,r-_)),_=h,(i.flags?l:ze(l))!==i.check){t.msg="incorrect data check",i.mode=Ue;break}l=0,d=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;d<32;){if(0===o)break t;o--,l+=a[s++]<<d,d+=8}if(l!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=Ue;break}l=0,d=0}i.mode=29;case 29:E=be;break t;case Ue:E=ye;break t;case 31:return ve;case 32:default:return ke}return t.next_out=r,t.avail_out=h,t.next_in=s,t.avail_in=o,i.hold=l,i.bits=d,(i.wsize||_!==t.avail_out&&i.mode<Ue&&(i.mode<27||e!==ue))&&Ze(t,t.output,t.next_out,_-t.avail_out),f-=t.avail_in,_-=t.avail_out,t.total_in+=f,t.total_out+=_,i.total+=_,i.wrap&&_&&(t.adler=i.check=i.flags?P(i.check,n,_,t.next_out-_):M(i.check,n,_,t.next_out-_)),t.data_type=i.bits+(i.last?64:0)+(i.mode===xe?128:0)+(20===i.mode||15===i.mode?256:0),(0===f&&0===_||e===ue)&&E===ge&&(E=Ee),E},inflateEnd:t=>{if(!t||!t.state)return ke;let e=t.state;return e.window&&(e.window=null),t.state=null,ge},inflateGetHeader:(t,e)=>{if(!t||!t.state)return ke;const i=t.state;return 0==(2&i.wrap)?ke:(i.head=e,e.done=!1,ge)},inflateSetDictionary:(t,e)=>{const i=e.length;let a,n,s;return t&&t.state?(a=t.state,0!==a.wrap&&11!==a.mode?ke:11===a.mode&&(n=1,n=M(n,e,i,0),n!==a.check)?ye:(s=Ze(t,e,i,i),s?(a.mode=31,ve):(a.havedict=1,ge))):ke},inflateInfo:"pako inflate (from Nodeca project)"};var Fe=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Me=Object.prototype.toString,{Z_NO_FLUSH:He,Z_FINISH:Pe,Z_OK:We,Z_STREAM_END:Ke,Z_NEED_DICT:$e,Z_STREAM_ERROR:Ye,Z_DATA_ERROR:je,Z_MEM_ERROR:Ge}=K;function Xe(t){this.options=Mt({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jt,this.strm.avail_out=0;let i=Ce.inflateInit2(this.strm,e.windowBits);if(i!==We)throw new Error(W[i]);if(this.header=new Fe,Ce.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Kt(e.dictionary):"[object ArrayBuffer]"===Me.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=Ce.inflateSetDictionary(this.strm,e.dictionary),i!==We)))throw new Error(W[i])}function Ve(t,e){const i=new Xe(e);if(i.push(t),i.err)throw i.msg||W[i.err];return i.result}Xe.prototype.push=function(t,e){const i=this.strm,a=this.options.chunkSize,n=this.options.dictionary;let s,r,o;if(this.ended)return!1;for(r=e===~~e?e:!0===e?Pe:He,"[object ArrayBuffer]"===Me.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(a),i.next_out=0,i.avail_out=a),s=Ce.inflate(i,r),s===$e&&n&&(s=Ce.inflateSetDictionary(i,n),s===We?s=Ce.inflate(i,r):s===je&&(s=$e));i.avail_in>0&&s===Ke&&i.state.wrap>0&&0!==t[i.next_in];)Ce.inflateReset(i),s=Ce.inflate(i,r);switch(s){case Ye:case je:case $e:case Ge:return this.onEnd(s),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||s===Ke))if("string"===this.options.to){let t=Yt(i.output,i.next_out),e=i.next_out-t,n=$t(i.output,t);i.next_out=e,i.avail_out=a-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(n)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==We||0!==o){if(s===Ke)return s=Ce.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},Xe.prototype.onData=function(t){this.chunks.push(t)},Xe.prototype.onEnd=function(t){t===We&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ht(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qe={Inflate:Xe,inflate:Ve,inflateRaw:function(t,e){return(e=e||{}).raw=!0,Ve(t,e)},ungzip:Ve,constants:K};const{Deflate:Je,deflate:Qe,deflateRaw:ti,gzip:ei}=re,{Inflate:ii,inflate:ai,inflateRaw:ni,ungzip:si}=qe;var ri=ii;const oi=[137,80,78,71,13,10,26,10],hi=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;hi[t]=e}const li=4294967295;function di(t,e){return(function(t,e,i){let a=t;for(let t=0;t<i;t++)a=hi[255&(a^e[t])]^a>>>8;return a}(li,t,e)^li)>>>0}var fi,_i,ci,ui;!function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.GREYSCALE=0]="GREYSCALE",t[t.TRUECOLOUR=2]="TRUECOLOUR",t[t.INDEXED_COLOUR=3]="INDEXED_COLOUR",t[t.GREYSCALE_ALPHA=4]="GREYSCALE_ALPHA",t[t.TRUECOLOUR_ALPHA=6]="TRUECOLOUR_ALPHA"}(fi||(fi={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.DEFLATE=0]="DEFLATE"}(_i||(_i={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.ADAPTIVE=0]="ADAPTIVE"}(ci||(ci={})),function(t){t[t.UNKNOWN=-1]="UNKNOWN",t[t.NO_INTERLACE=0]="NO_INTERLACE",t[t.ADAM7=1]="ADAM7"}(ui||(ui={}));const wi=new Uint8Array(0),pi=new Uint16Array([255]),gi=255===new Uint8Array(pi.buffer)[0];class PNGDecoder extends IOBuffer_IOBuffer{constructor(t,e={}){super(t);const{checkCrc:i=!1}=e;this._checkCrc=i,this._inflator=new ri,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._end=!1,this._hasPalette=!1,this._palette=[],this._compressionMethod=_i.UNKNOWN,this._filterMethod=ci.UNKNOWN,this._interlaceMethod=ui.UNKNOWN,this._colorType=-1,this.setBigEndian()}decode(){for(this.decodeSignature();!this._end;)this.decodeChunk();return this.decodeImage(),this._png}decodeSignature(){for(let t=0;t<oi.length;t++)if(this.readUint8()!==oi[t])throw new Error(`wrong PNG signature. Byte at ${t} should be ${oi[t]}.`)}decodeChunk(){const t=this.readUint32(),e=this.readChars(4),i=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"tEXt":this.decodetEXt(t);break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-i!==t)throw new Error(`Length mismatch while decoding chunk ${e}`);if(this._checkCrc){const i=this.readUint32(),a=t+4,n=di(new Uint8Array(this.buffer,this.byteOffset+this.offset-a-4,a),a);if(n!==i)throw new Error(`CRC mismatch for chunk ${e}. Expected ${i}, found ${n}`)}else this.skip(4)}decodeIHDR(){const t=this._png;t.width=this.readUint32(),t.height=this.readUint32(),t.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw new Error(`invalid bit depth: ${t}`);return t}(this.readUint8());const e=this.readUint8();let i;switch(this._colorType=e,e){case fi.GREYSCALE:i=1;break;case fi.TRUECOLOUR:i=3;break;case fi.INDEXED_COLOUR:i=1;break;case fi.GREYSCALE_ALPHA:i=2;break;case fi.TRUECOLOUR_ALPHA:i=4;break;default:throw new Error(`Unknown color type: ${e}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==_i.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodePLTE(t){if(t%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);const e=t/3;this._hasPalette=!0;const i=[];this._palette=i;for(let t=0;t<e;t++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._inflator.push(new Uint8Array(this.buffer,this.offset+this.byteOffset,t)),this.skip(t)}decodetRNS(t){if(3===this._colorType){if(t>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){const t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255)}}decodetEXt(t){let e,i="";for(;"\\0"!==(e=this.readChar());)i+=e;this._png.text[i]=this.readChars(t-i.length-1)}decodepHYs(){const t=this.readUint32(),e=this.readUint32(),i=this.readByte();this._png.resolution={x:t,y:e,unit:i}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const t=this._inflator.result;if(this._filterMethod!==ci.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod!==ui.NO_INTERLACE)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this.decodeInterlaceNull(t)}decodeInterlaceNull(t){const e=this._png.height,i=this._png.channels*this._png.depth/8,a=this._png.width*i,n=new Uint8Array(this._png.height*a);let s,r,o=wi,h=0;for(let l=0;l<e;l++){switch(s=t.subarray(h+1,h+1+a),r=n.subarray(l*a,(l+1)*a),t[h]){case 0:bi(s,r,a);break;case 1:mi(s,r,a,i);break;case 2:ki(s,r,o,a);break;case 3:yi(s,r,o,a,i);break;case 4:vi(s,r,o,a,i);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}o=r,h+=a+1}if(this._hasPalette&&(this._png.palette=this._palette),16===this._png.depth){const t=new Uint16Array(n.buffer);if(gi)for(let e=0;e<t.length;e++)t[e]=(255&(l=t[e]))<<8|l>>8&255;this._png.data=t}else this._png.data=n;var l}}function bi(t,e,i){for(let a=0;a<i;a++)e[a]=t[a]}function mi(t,e,i,a){let n=0;for(;n<a;n++)e[n]=t[n];for(;n<i;n++)e[n]=t[n]+e[n-a]&255}function ki(t,e,i,a){let n=0;if(0===i.length)for(;n<a;n++)e[n]=t[n];else for(;n<a;n++)e[n]=t[n]+i[n]&255}function yi(t,e,i,a,n){let s=0;if(0===i.length){for(;s<n;s++)e[s]=t[s];for(;s<a;s++)e[s]=t[s]+(e[s-n]>>1)&255}else{for(;s<n;s++)e[s]=t[s]+(i[s]>>1)&255;for(;s<a;s++)e[s]=t[s]+(e[s-n]+i[s]>>1)&255}}function vi(t,e,i,a,n){let s=0;if(0===i.length){for(;s<n;s++)e[s]=t[s];for(;s<a;s++)e[s]=t[s]+e[s-n]&255}else{for(;s<n;s++)e[s]=t[s]+i[s]&255;for(;s<a;s++)e[s]=t[s]+Ei(e[s-n],i[s],i[s-n])&255}}function Ei(t,e,i){const a=t+e-i,n=Math.abs(a-t),s=Math.abs(a-e),r=Math.abs(a-i);return n<=s&&n<=r?t:s<=r?e:i}var Ai;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(Ai||(Ai={})),self.addEventListener("message",(t=>{const e=t.data,i=new PNGDecoder(e,a).decode();var a;const n=i.data.buffer;postMessage({data:n,width:i.width,height:i.height},[n])}))})()})();',
          "Worker",
          void 0,
          void 0
        );
      });
      let et = null;
      function it(t) {
        return function () {
          return (function (t) {
            return et || (et = new ImageLoader(t, tt)), et;
          })(t);
        };
      }
      const nt = new o.Z("LoaderComponent");
      var st;
      !(function (t) {
        (t.Idle = "Idle"),
          (t.Loading = "Loading"),
          (t.Loaded = "Loaded"),
          (t.Error = "Error");
      })(st || (st = {}));
      const rt = (t) => new LoaderComponent(new t()),
        at = (t, e) => {
          if (t && (e(t), t.children && t.children.length > 0))
            for (const i of t.children) at(i, e);
        },
        ot = (t) => {
          at(t, (t) => {
            if ("Mesh" === t.type) {
              const e = t;
              if ((e.geometry && e.geometry.dispose(), e.material))
                if (Array.isArray(e.material)) {
                  const t = e.material;
                  for (const e of t) e.dispose();
                } else {
                  e.material.dispose();
                }
            }
          });
        };
      class LoaderComponent {
        constructor(t) {
          (this.assetLoader = t),
            (this.visibleCache = !0),
            (this.urlCache = ""),
            (this.materialUrlCache = ""),
            (this.pivot = null),
            (this.inputs = {
              url: "",
              materialUrl: "",
              visible: !0,
              onLoaded: (t) => {},
              localScale: { x: 1, y: 1, z: 1 },
              localRotation: { x: 0, y: 0, z: 0 },
              localPosition: { x: 0, y: 0, z: 0 },
              colliderEnabled: !0,
            }),
            (this.events = { [n.CLICK]: !0, [n.HOVER]: !0, [n.DRAG]: !1 }),
            (this.outputs = { loadingState: st.Idle });
        }
        onInit() {
          this.checkForUpdates();
        }
        onInputsUpdated() {
          this.checkForUpdates();
        }
        onEvent(t, e) {
          this.notify(t, e);
        }
        onDestroy() {
          this.pivot &&
            (ot(this.pivot),
            (this.outputs.objectRoot = null),
            (this.pivot = null));
        }
        async checkForUpdates() {
          if (
            this.inputs.url !== this.urlCache ||
            this.inputs.materialUrl !== this.materialUrlCache
          ) {
            if (
              ((this.urlCache = this.inputs.url),
              (this.materialUrlCache = this.inputs.materialUrl),
              null === this.inputs.url)
            )
              return void (this.outputs.loadingState = st.Idle);
            const t = this.pivot;
            (this.pivot = new E.Object3D()),
              (this.outputs.objectRoot = null),
              (this.outputs.collider = null),
              t && ot(t),
              nt.debug(`Loading ${this.inputs.url}`),
              (this.outputs.loadingState = st.Loading);
            const e = this.inputs.url;
            let i,
              n = !1;
            try {
              i = await this.assetLoader.load(
                this.inputs.url,
                this.inputs.materialUrl
              );
            } catch (t) {
              n = !0;
            }
            if (e !== this.inputs.url)
              return void nt.debug(
                `Ignoring url ${e} since the input url changed during loading.`
              );
            if (n || !i) return void (this.outputs.loadingState = st.Error);
            this.pivot.add(i.objectRoot),
              (this.outputs.objectRoot = this.pivot);
          }
          if (
            (this.inputs.visible !== this.visibleCache &&
              this.outputs.objectRoot &&
              ((this.visibleCache = this.inputs.visible),
              (this.outputs.objectRoot.visible = this.visibleCache)),
            this.outputs.objectRoot &&
              (this.outputs.collider = this.inputs.colliderEnabled
                ? this.pivot
                : null),
            this.outputs.objectRoot && this.pivot)
          ) {
            const t = this.pivot.children[0],
              e = new E.Euler(
                (this.inputs.localRotation.x * Math.PI) / 180,
                (this.inputs.localRotation.y * Math.PI) / 180,
                (this.inputs.localRotation.z * Math.PI) / 180,
                "YXZ"
              );
            this.pivot.quaternion.setFromEuler(e),
              t.scale.set(
                this.inputs.localScale.x,
                this.inputs.localScale.y,
                this.inputs.localScale.z
              ),
              t.position.set(
                this.inputs.localPosition.x,
                this.inputs.localPosition.y,
                this.inputs.localPosition.z
              );
          }
          (this.outputs.loadingState = st.Loaded),
            this.inputs.onLoaded(this.outputs.objectRoot || null);
        }
      }
      var lt;
      !(function (t) {
        (t.ONACCESSGRANTED = "ONACCESSGRANTED"),
          (t.ONACCESSREVOKED = "ONACCESSREVOKED");
      })(lt || (lt = {}));
      const ht = (t) => {
        class CameraComponent {
          constructor() {
            (this.sub = null),
              (this.controller = null),
              (this.tmpPosition = new E.Vector3()),
              (this.tmpQuaternion = new E.Quaternion()),
              (this.inputs = { enabled: !1, camera: null });
          }
          onInit() {
            this.inputs.enabled && this.requestControl();
          }
          onInputsUpdated(t) {
            t.enabled && this.release(),
              this.inputs.enabled && this.requestControl();
          }
          onTick() {
            const t = this.inputs.camera;
            t &&
              this.controller &&
              (t.getWorldPosition(this.tmpPosition),
              t.getWorldQuaternion(this.tmpQuaternion),
              this.controller.updateCameraPosition(this.tmpPosition),
              this.controller.updateCameraRotation(this.tmpQuaternion));
          }
          onDestroy() {
            this.release();
          }
          release() {
            this.sub && (this.sub.cancel(), (this.sub = null));
          }
          requestControl() {
            this.sub = t.newSession(
              new (class Requester {
                constructor(t) {
                  this.component = t;
                }
                onAccessGranted(t) {
                  (this.component.controller = t),
                    this.notify(t, lt.ONACCESSGRANTED);
                }
                onAccessRevoked(t) {
                  (this.component.controller = null),
                    this.notify(t, lt.ONACCESSREVOKED);
                }
                notify(e, i) {
                  const n = this.component,
                    s = { pose: t.pose, controller: e };
                  n.notify(i, s);
                }
              })(this)
            );
          }
        }
        return () => new CameraComponent();
      };
      var dt = i(49340),
        ct = i(81040),
        ut = i(88727),
        pt = i(33665),
        ft = i(77417),
        _t = i(38022),
        mt = i(63757);
      const wt = (t, e) => {
        class InputComponent {
          constructor() {
            (this.subs = []),
              (this.inputs = {
                eventsEnabled: !0,
                userNavigationEnabled: !0,
                unfiltered: !0,
              }),
              (this.isUserNavigationEnabled =
                this.isUserNavigationEnabled.bind(this));
          }
          subHandler(e, i) {
            this.inputs.unfiltered
              ? this.subs.push(
                  t.registerUnfilteredHandler(e, (t) => this.notify(i, t))
                )
              : this.subs.push(t.registerHandler(e, (t) => this.notify(i, t)));
          }
          isUserNavigationEnabled() {
            return this.inputs.userNavigationEnabled;
          }
          onInit() {
            e.addNavigationRule(this.isUserNavigationEnabled),
              this.inputs.eventsEnabled && this.subscribeAll();
          }
          onInputsUpdated(t) {
            t.eventsEnabled !== this.inputs.eventsEnabled
              ? this.inputs.eventsEnabled
                ? this.subscribeAll()
                : this.cancelAll()
              : t.unfiltered !== this.inputs.unfiltered &&
                this.inputs.eventsEnabled &&
                (this.cancelAll(), this.subscribeAll());
          }
          onDestroyed() {
            e.removeNavigationRule(this.isUserNavigationEnabled),
              this.cancelAll();
          }
          subscribeAll() {
            this.subs.length > 0
              ? this.subs.forEach((t) => t.renew())
              : (this.subHandler(dt.mE, n.POINTER_MOVE),
                this.subHandler(C.E0, n.DRAG_BEGIN),
                this.subHandler(C._t, n.DRAG),
                this.subHandler(C._R, n.DRAG_END),
                this.subHandler(ct.a, n.SCROLL),
                this.subHandler(dt.er, n.POINTER_BUTTON),
                this.subHandler(ut.e, n.KEY),
                this.subHandler(k.R, n.CLICK),
                this.subHandler(pt.Vh, n.LONG_PRESS_START),
                this.subHandler(pt.pt, n.LONG_PRESS_END),
                this.subHandler(ft.d, n.MULTI_SWIPE),
                this.subHandler(ft.h, n.MULTI_SWIPE_END),
                this.subHandler(_t.G, n.PINCH),
                this.subHandler(_t.i, n.PINCH_END),
                this.subHandler(mt.D, n.ROTATE),
                this.subHandler(mt.u, n.ROTATE_END));
          }
          cancelAll() {
            this.subs.forEach((t) => t.cancel());
          }
        }
        return () => new InputComponent();
      };
      var gt = i(29539);
      const bt = (t) => {
        class XrComponent {
          constructor() {
            this.outputs = { session: null };
          }
          onTick() {
            this.outputs.session = t.xr.getSession();
          }
        }
        return () => new XrComponent();
      };
      function yt(t) {
        if (null == t || isNaN(t)) return !1;
        if ("number" == typeof t) return !0;
        const e = parseFloat(t);
        return !isNaN(e) && "number" == typeof e;
      }
      class PropertyBinder {
        constructor() {
          (this.target = null),
            (this.targetProp = null),
            (this.src = null),
            (this.srcProp = null);
        }
        bind(t, e, i, n) {
          (this.target = t),
            (this.targetProp = e),
            (this.src = i),
            (this.srcProp = n),
            (this.initialTargetValue = this.target[this.targetProp]),
            (this.target[this.targetProp] = this.src[this.srcProp]),
            (this.subscription = this.src.onPropertyChanged(
              this.srcProp,
              (t) => {
                this.target &&
                  this.targetProp &&
                  (this.target[this.targetProp] = t);
              }
            ));
        }
        unbind() {
          this.target &&
            this.targetProp &&
            ((this.target[this.targetProp] = this.initialTargetValue),
            (this.target = null),
            (this.targetProp = null)),
            this.src &&
              this.srcProp &&
              (this.subscription && this.subscription.cancel(),
              (this.src = null),
              (this.srcProp = null));
        }
      }
      class DictionaryBinder {
        constructor(t) {
          (this.target = t), (this.bindings = {});
        }
        bind(t, e, i) {
          if (this.bindings[t]) throw Error(`Property ${t} already bound.`);
          const n = new PropertyBinder();
          n.bind(this.target, t, e, i), (this.bindings[t] = n);
        }
        unbind(t) {
          const e = this.bindings[t];
          e && (e.unbind(), delete this.bindings[t]);
        }
      }
      const vt = new o.Z("SceneObject");
      var Et, xt;
      !(function (t) {
        (t[(t.Idle = 0)] = "Idle"),
          (t[(t.Operating = 1)] = "Operating"),
          (t[(t.Stopped = 2)] = "Stopped");
      })(Et || (Et = {}));
      class SceneObject {
        constructor(t, e) {
          (this.nodeFactory = t),
            (this.eventBus = e),
            (this.state = Et.Idle),
            (this.nodes = []),
            (this.paths = new Map()),
            (this.bindingMap = new Map()),
            (this.dictionaryBinders = new Map()),
            (this.idTracker = new IdTracker());
        }
        addNode(t) {
          if (this.state !== Et.Idle)
            return (
              vt.warn("Cannot add node after the scene object has started"),
              null
            );
          const e = this.nodeFactory.createNode(this);
          if ((this.nodes.push(e), t)) {
            if (!this.idTracker.isAvailable(t))
              throw Error("Component with duplicate id detected.");
            if (-1 !== t.indexOf("/"))
              throw Error('Node ids cannot have "/" character.');
            this.idTracker.reserve(t);
          }
          const i = t || this.idTracker.nextId();
          return (
            Object.defineProperty(e, "id", {
              value: i,
              writable: !1,
              enumerable: !0,
            }),
            e
          );
        }
        *nodeIterator() {
          for (const t of this.nodes) yield t;
        }
        *bindings() {
          for (const t of this.bindingMap) yield t;
        }
        *pathIterator() {
          for (const [, t] of this.paths) {
            let e = null;
            _(t)
              ? (e = new OutputPath(t))
              : m(t)
              ? (e = new InputPath(t))
              : g(t)
              ? (e = new EmitPath(t))
              : w(t) && (e = new EventPath(t)),
              null !== e && (yield { desc: t, path: e });
          }
        }
        start() {
          if (this.state === Et.Idle) {
            for (const t of this.nodes) t.start();
            this.state = Et.Operating;
          } else vt.warn("A scene object cannot be restarted.");
        }
        stop() {
          if (this.state === Et.Operating) {
            for (const t of this.nodes) t.stop();
            this.state = Et.Stopped;
          }
        }
        bindPath(t, e) {
          if (m(t) && _(e)) {
            const i =
              this.dictionaryBinders.get(t.component) ||
              new DictionaryBinder(t.component.inputs || {});
            return (
              this.dictionaryBinders.set(t.component, i),
              i.bind(t.property, e.component.outputs, e.property),
              void this.bindingMap.set(t, e)
            );
          }
          if (w(t) && g(e))
            return (
              this.bindingMap.set(t, e),
              void (function (t, e, i) {
                const n = e.component,
                  s = e.property,
                  r = i.component,
                  a = i.property;
                t.observe({
                  src: r,
                  srcEventType: a,
                  targetEventType: s,
                  onEvent(t, e) {
                    n.events[t] && n.onEvent && n.onEvent(t, e);
                  },
                });
              })(this.eventBus, t, e)
            );
          throw Error(
            'Couldn\'t bind. Only an "output" can be bound to an "input", or an "emit" to an "event"'
          );
        }
        bind(t, e, i, n) {
          if (this.state !== Et.Idle)
            throw Error("bind cannot be called after starting the scene node.");
          if (!t || !i) throw Error("Some bind parameters were undefined.");
          const s = this.addPath({
              id: "input-" + this.idTracker.nextId(),
              type: f.INPUT,
              node: t.context.root,
              component: t,
              property: e,
            }),
            r = this.addPath({
              id: "output-" + this.idTracker.nextId(),
              type: f.OUTPUT,
              node: i.context.root,
              component: i,
              property: n,
            });
          this.bindPath(s, r);
        }
        findNodeById(t) {
          return this.nodes.find((e) => e.id === t) || null;
        }
        addPath(t) {
          if (!this.idTracker.isAvailable(t.id))
            throw Error("Duplicate id detected.");
          if (-1 !== t.id.indexOf("/"))
            throw Error('Path ids cannot have "/" character.');
          let e;
          if (_(t)) {
            if (!(t.property in t.component.outputs))
              throw Error(t.property + ' is not an "output" of the component');
            e = new OutputPath(t);
          } else if (m(t)) {
            if (!t.component.inputs || !(t.property in t.component.inputs))
              throw Error(t.property + ' is not an "input" of the component');
            e = new InputPath(t);
          } else if (w(t)) {
            if (!(t.property in t.component.events))
              throw Error(t.property + ' is not an "event" of the component');
            e = new EventPath(t);
          } else if (g(t)) {
            if (!t.component.emits || !(t.property in t.component.emits))
              throw Error(t.property + ' is not an "emit" of the component');
            e = new EmitPath(t);
          } else if (t.type) throw Error("Couldn't determine path type");
          return (
            this.idTracker.reserve(t.id),
            this.paths.set(t.id, Object.assign({}, t)),
            e
          );
        }
        spyOnEvent(t) {
          const { path: e } = t,
            { node: i, component: n, type: s, property: r } = e;
          if (m(e)) return n.inputs.onPropertyChanged(r, (e) => t.onEvent(e));
          if (_(e)) return n.outputs.onPropertyChanged(r, (e) => t.onEvent(e));
          if (g(e)) return this.eventBus.observe(new SceneObjectEventSpy(t));
          throw Error(
            `spy.path: ${h(i, n, s, r)}, is not a valid path to spy on`
          );
        }
        setValueAtPath(t, e) {
          vt.warn(
            "`SceneObject.setValueAtPath` has been deprecated. Use `InputPath.set() instead."
          );
          const i = t.component.inputs;
          i && t.property && t.property in i
            ? (i[t.property] = e)
            : vt.warn(
                `setValueAtPath called on component without input "${t.property}"`
              );
        }
        getValueAtPath(t) {
          vt.warn(
            "`SceneObject.setValueAtPath` has been deprecated. Use `OutputPath.get() instead."
          );
          const e = t.component.outputs;
          if (e && t.property && e[t.property]) return e[t.property];
          vt.warn(
            `getValueAtPath called on path that does not exist "${t.property}"`
          );
        }
      }
      class SceneObjectEventSpy {
        constructor(t) {
          (this.sceneObjectSpy = t),
            (this.src = t.path.component),
            (this.srcEventType = t.path.property),
            (this.targetEventType = t.path.property);
        }
        onEvent(t, e) {
          this.sceneObjectSpy.onEvent(e);
        }
      }
      function kt(t) {
        return (
          !!t &&
          !!(
            "object" == typeof t &&
            "x" in t &&
            "y" in t &&
            "z" in t &&
            yt(t.x) &&
            yt(t.y) &&
            yt(t.z)
          )
        );
      }
      function At(t, e) {
        const { position: i, rotation: n, scale: s } = e,
          r = t.createNode();
        if (((r.name = e.name || "Unnamed Node"), i)) {
          if (!kt(i)) throw Error(`Invalid position ${JSON.stringify(i)}`);
          r.position.set(i.x, i.y, i.z);
        }
        if (n) {
          if (!kt(n)) throw Error(`Invalid rotation ${JSON.stringify(n)}`);
          r.quaternion.setFromEuler(
            new E.Euler(
              (n.x * Math.PI) / 180,
              (n.y * Math.PI) / 180,
              (n.z * Math.PI) / 180,
              "YXZ"
            )
          );
        }
        if (s) {
          if (!kt(s)) throw Error(`Invalid scale ${JSON.stringify(s)}`);
          r.scale.set(s.x, s.y, s.z);
        }
        for (const t of e.components) Ct(r, t);
        return r;
      }
      function Ct(t, e) {
        const i = t.addComponent(e.type, e.inputs, e.id);
        if (i) {
          for (const t in e.events) i.events[t] = e.events[t];
          if (i.emits) for (const t in e.emits) i.emits[t] = e.emits[t];
        }
        return i;
      }
      function St(t) {
        const e = new E.Euler();
        e.setFromQuaternion(t.quaternion, "YXZ");
        const i = 180 / Math.PI;
        return {
          id: t.id,
          name: t.name,
          position: { x: t.position.x, y: t.position.y, z: t.position.z },
          rotation: { x: e.x * i, y: e.y * i, z: e.z * i },
          scale: { x: t.scale.x, y: t.scale.y, z: t.scale.z },
          components: Ut(t),
        };
      }
      function Ut(t) {
        const e = [];
        for (const i of t.componentIterator()) {
          const t = {
            id: i.id,
            type: i.componentType,
            inputs: Object.assign({}, i.inputs),
            emits: {},
            events: {},
          };
          for (const e in i.emits) t.emits[e] = !!i.emits[e];
          for (const e in i.events) t.events[e] = !!i.events[e];
          e.push(t);
        }
        return e;
      }
      !(function (t) {
        (t.V_1_0 = "1.0"), (t.V_2_0 = "2.0"), (t.V_2_1 = "2.1");
      })(xt || (xt = {}));
      const Tt = (t, e, i) => {
          const n = new SceneObject(t, e),
            s = [];
          for (const t of i.objects) {
            const e = jt(
              {
                createNode: function () {
                  return n.addNode(t.id);
                },
              },
              t
            );
            s.push(e);
          }
          if (
            (i.bindings &&
              (function (t, e, i) {
                for (const i of e)
                  if (2 === i.length) {
                    const [e, n] = i,
                      s = u(e, t),
                      r = u(n, t);
                    if (null === s.component || null === s.property)
                      throw Error(`Could not resolve target for path '${e}'`);
                    if (null === r.component || null === r.property)
                      throw Error(`Could not resolve source for path '${n}'`);
                    s.component.bind(s.property, r.component, r.property);
                  }
              })(n, i.bindings),
            i.events &&
              (function (t, e, i) {
                for (const i of e)
                  if (2 === i.length) {
                    const [e, n] = i,
                      s = u(e, t),
                      r = u(n, t);
                    if (null === s.component || null === s.property)
                      throw Error(`Could not resolve target for path '${e}'`);
                    if (null === r.component || null === r.property)
                      throw Error(`Could not resolve source for path '${n}'`);
                    s.component.bindEvent(s.property, r.component, r.property);
                  }
              })(n, i.events),
            i.paths)
          )
            for (const t of i.paths) {
              const e = u(t[1], n);
              if (
                !(
                  e.node &&
                  e.component &&
                  e.property &&
                  p(e.property, e.component)
                )
              )
                throw Error(`Unable to parse path "${t[1]}"`);
              {
                const i = p(e.property, e.component);
                i &&
                  n.addPath({
                    id: t[0],
                    type: i,
                    node: e.node,
                    component: e.component,
                    property: e.property,
                  });
              }
            }
          return n;
        },
        jt = (t, e) => {
          const i = e.position,
            n = e.scale,
            s = e.rotation,
            r = t.createNode(),
            a = e.name || "Unnamed Node";
          if (((r.name = a), i)) {
            if (!yt(i.x) || !yt(i.y) || !yt(i.z))
              throw new Error(`Invalid position ${JSON.stringify(i)}`);
            r.position.set(i.x, i.y, i.z);
          } else r.position.set(0, 0, 0);
          if (s) {
            if (!yt(s.x) || !yt(s.y) || !yt(s.z))
              throw new Error(`Invalid rotation ${JSON.stringify(s)}`);
            r.quaternion.setFromEuler(
              new E.Euler(
                (s.x * Math.PI) / 180,
                (s.y * Math.PI) / 180,
                (s.z * Math.PI) / 180,
                "YXZ"
              )
            );
          } else r.quaternion.set(0, 0, 0, 1);
          if (n) {
            if (!yt(n.x) || !yt(n.y) || !yt(n.z))
              throw new Error(`Invalid scale ${JSON.stringify(n)}`);
            r.scale.set(n.x, n.y, n.z);
          } else r.scale.set(1, 1, 1);
          const o = [];
          if (e.components)
            for (const t of e.components) {
              const e = Lt(r, t);
              e && o.push(e);
            }
          return (
            e.bindings &&
              (function (t, e, i) {
                for (const n of e)
                  if (4 === n.length) {
                    const [t, e, s, r] = n,
                      a = i[t],
                      o = i[s];
                    if (!a)
                      throw Error("could not find target Component index=" + t);
                    if (!o)
                      throw Error("could not find source Component index=" + s);
                    a.bind(e, o, r);
                  } else if (2 === n.length) {
                    const [e, i] = n,
                      s = c(e, t),
                      r = c(i, t);
                    if (null === s.component || null === s.property)
                      throw Error(`Could not resolve target for path '${e}'`);
                    if (null === r.component || null === r.property)
                      throw Error(`Could not resolve source for path '${i}'`);
                    s.component.bind(s.property, r.component, r.property);
                  }
              })(r, e.bindings, o),
            e.events &&
              (function (t, e, i) {
                for (const n of e)
                  if (4 === n.length) {
                    const [t, e, s, r] = n,
                      a = i[t],
                      o = i[s];
                    if (!a)
                      throw Error("could not find target Component index=" + t);
                    if (!o)
                      throw Error("could not find source Component index=" + s);
                    if (!(e in a.events))
                      throw Error(
                        "Component index=" +
                          t +
                          ' does not have "' +
                          e +
                          '" as a handled event'
                      );
                    a.bindEvent(e, o, r);
                  } else if (2 === n.length) {
                    const [e, i] = n,
                      s = c(e, t),
                      r = c(i, t);
                    if (null === s.component || null === s.property)
                      throw Error(
                        `Could not resolve target for event path '${e}'`
                      );
                    if (null === r.component || null === r.property)
                      throw Error(
                        `Could not resolve source for event path '${i}'`
                      );
                    s.component.bindEvent(s.property, r.component, r.property);
                  }
              })(r, e.events, o),
            r
          );
        },
        Lt = function (t, e) {
          const i = t.addComponent(e.type, e.inputs, e.id);
          if (i) for (const t in e.events) i.events[t] = e.events[t];
          return i;
        };
      const Rt = (t, e, i) => {
          const n = JSON.parse(i),
            s = n.version;
          switch (s) {
            case xt.V_1_0:
              return ((t, e) => {
                const i = [];
                for (const n of e.objects) {
                  const e = jt(t, n);
                  i.push(e);
                }
                return i;
              })(t, n.payload);
            case xt.V_2_0:
              return Tt(t, e, n.payload);
            case xt.V_2_1:
              return (function (t, e, i) {
                const n = new SceneObject(t, e),
                  s = [];
                for (const t of i.objects) {
                  const e = { createNode: () => n.addNode(t.id) };
                  s.push(At(e, t));
                }
                const r = new Map(),
                  a = new Map(),
                  o = new Map(),
                  l = new Map();
                for (const [t, e] of i.paths) {
                  const i = u(e, n),
                    { node: s, component: h, type: d, property: c } = i;
                  if (s && h && d && c) {
                    const i = { id: t, node: s, component: h, property: c };
                    switch (d) {
                      case f.OUTPUT:
                        r.set(
                          t,
                          n.addPath(
                            Object.assign(Object.assign({}, i), { type: d })
                          )
                        );
                        break;
                      case f.INPUT:
                        a.set(
                          t,
                          n.addPath(
                            Object.assign(Object.assign({}, i), { type: d })
                          )
                        );
                        break;
                      case f.EVENT:
                        o.set(
                          t,
                          n.addPath(
                            Object.assign(Object.assign({}, i), { type: d })
                          )
                        );
                        break;
                      case f.EMIT:
                        l.set(
                          t,
                          n.addPath(
                            Object.assign(Object.assign({}, i), { type: d })
                          )
                        );
                        break;
                      default:
                        throw Error(`unable to parse path "${e}"`);
                    }
                  }
                }
                for (const [t, e] of i.bindings) {
                  const i = a.get(t) || o.get(t);
                  if (!i)
                    throw Error(`"${t}" not found in input or event paths`);
                  const s = r.get(e) || l.get(e);
                  if (!s)
                    throw Error(`"${t}" not found in output or emit paths`);
                  n.bindPath(i, s);
                }
                return n;
              })(t, e, n.payload);
            default:
              throw Error(`Unsupported scene version ${s}`);
          }
        },
        Ot = (t) => {
          const e = (function (t) {
            const e = { objects: [], bindings: [], paths: [] };
            for (const i of t.nodeIterator()) {
              const t = St(i);
              e.objects.push(t);
            }
            for (const [i, n] of t.bindings()) {
              const t = [i.id, n.id];
              e.bindings.push(t);
            }
            for (const i of t.pathIterator()) {
              const t = h(
                i.desc.node,
                i.desc.component,
                i.desc.type,
                i.desc.property
              );
              e.paths.push([i.desc.id, t]);
            }
            return e;
          })(t);
          return JSON.stringify({ version: xt.V_2_1, payload: e });
        };
      var It = i(32653);
      class ComponentLoader {
        constructor(t, e) {
          (this.engine = t),
            (this.sceneModule = e),
            (this.queuedComponents = new Set()),
            (this.started = !1);
        }
        start() {
          (this.started = !0), this.addQueuedComponents();
        }
        addComponent(t) {
          this.started ? this.addToEngine(t) : this.queuedComponents.add(t);
        }
        removeComponent(t) {
          this.engine.removeComponent(this.sceneModule, t),
            this.queuedComponents.delete(t);
        }
        addQueuedComponents() {
          for (const t of this.queuedComponents) this.addToEngine(t);
        }
        addToEngine(t) {
          this.engine.addComponent(this.sceneModule, t);
        }
      }
      class SceneModule extends s.Y {
        constructor() {
          super(...arguments),
            (this.name = "scene"),
            (this.componentFactory = new ComponentBuilder()),
            (this.eventBus = new ComponentEventBus());
        }
        async init(t, e) {
          let i, n, s;
          (this.componentLoader = new ComponentLoader(e, this)),
            ([i, this.renderer, this.raycasterModule, this.inputIni, n, s] =
              await Promise.all([
                e.getModule(W.default),
                e.getModuleBySymbol(r.y.WEBGL_RENDERER),
                e.getModule(H.default),
                e.getModuleBySymbol(r.y.INPUT),
                e.market.waitForData(X.I),
                e.getModule(gt.default),
              ])),
            (this.analytics = new SceneAnalytics(i, n)),
            (this.tags = new Tags()),
            (function (t, e) {
              for (const t of B) {
                const e = Object.keys(t);
                for (const i of e) {
                  const e = t[i],
                    n = E;
                  if (i in n) {
                    if ("object" == typeof e)
                      for (const t in e) t in n[i] || (n[i][t] = e[t]);
                  } else n[i] = e;
                }
              }
              E.DefaultLoadingManager.addHandler(/\.tga$/i, new F.TGALoader()),
                E.DefaultLoadingManager.addHandler(/\.jpe?g$/i, t()),
                E.DefaultLoadingManager.addHandler(/\.png$/i, e()),
                (E.Cache.enabled = !0);
            })(
              Q(this.renderer.cwfRenderer.renderer),
              it(this.renderer.cwfRenderer.renderer)
            ),
            this.registerFactory(OBJLoader2Component.factoryName, () =>
              rt(OBJLoader2Component)
            ),
            this.registerFactory(FBXLoaderComponent.factoryName, () =>
              rt(FBXLoaderComponent)
            ),
            this.registerFactory(ColladaLoaderComponent.factoryName, () =>
              rt(ColladaLoaderComponent)
            ),
            this.registerFactory(GLTFLoaderComponent.factoryName, () =>
              rt(GLTFLoaderComponent)
            ),
            this.registerFactory(
              ScrollingTube.factoryName,
              ScrollingTube.factory
            ),
            this.registerFactory(
              TransformControlsComponent.factoryName,
              TransformControlsComponent.factory
            ),
            this.registerFactory(
              LightsComponents.factoryName,
              LightsComponents.factory
            ),
            this.registerFactory(
              PointLightComponent.factoryName,
              PointLightComponent.factory
            ),
            this.registerFactory(
              DirectionalLightComponent.factoryName,
              DirectionalLightComponent.factory
            ),
            this.registerFactory(
              AmbientLightComponent.factoryName,
              AmbientLightComponent.factory
            ),
            this.registerFactory("mp.camera", ht(t.cameraPoseProxy)),
            this.registerFactory("mp.input", wt(this.inputIni, s)),
            this.registerFactory(
              "mp.xr",
              bt(this.renderer.cwfRenderer.renderer)
            );
          const a = (t) => {
            this.tags.tagObject(t.root, [G.Model]);
            for (const e of t.floors) {
              this.tags.tagObject(e, [G.Floor]);
              for (const e of t.rooms) this.tags.tagObject(e, [G.Room]);
            }
            this.tags.tagObject(this.renderer.getScene().scene, [G.Scene]);
          };
          e.market.waitForData(It.s).then((t) => {
            a(t), t.onChanged(a);
          }),
            (this.contextPropertyAccessor =
              new TrackFirstPropertyAnalyticsWrapper(this.analytics)),
            (this.componentStartAnalytics = new TrackFirstKeyAnalytics(
              this.analytics
            ));
        }
        registerFactory(t, e) {
          this.componentFactory.registerFactory(t, e);
        }
        createNode(t) {
          return (
            (t = t || new SceneObject(this, this.eventBus)),
            new SceneNode(
              this.componentLoader,
              this.renderer,
              this.raycasterModule.targets,
              this.componentStartAnalytics,
              this.componentFactory,
              t,
              this.eventBus,
              this.inputIni,
              this.contextPropertyAccessor,
              this
            )
          );
        }
        createObject() {
          return new SceneObject(this, this.eventBus);
        }
        startLoading() {
          this.componentLoader.start();
        }
        sceneTags() {
          return this.tags;
        }
        serialize(t) {
          return Ot(t);
        }
        deserialize(t) {
          return Rt(this, this.eventBus, t);
        }
        get supportedSerializerVersions() {
          return xt;
        }
        componentMap() {
          return {
            FBX_LOADER: FBXLoaderComponent.factoryName,
            DAE_LOADER: ColladaLoaderComponent.factoryName,
            OBJ_LOADER: OBJLoader2Component.factoryName,
            GLTF_LOADER: GLTFLoaderComponent.factoryName,
            SCROLLING_TUBE: ScrollingTube.factoryName,
            TRANSFORM_CONTROLS: TransformControlsComponent.factoryName,
            SIMPLE_LIGHTS: LightsComponents.factoryName,
          };
        }
      }
    },
    13515: () => {},
  },
]);
